Answers for "alpine function"

0

alpine function

<div class="card" 
     x-data="data()" 
     @click="foo(number)" 
     x-text="number">
</div>    
<!-- ... -->
<script>
  function data(){
    return {
      number: '456',
      foo(num){
        alert(num);
      }
    }
  }
</script>
Posted by: Guest on October-22-2021

Browse Popular Code Answers by Language