fungsi alpine

<div class="card" 
     x-data="data()" 
     @click="foo(number)" 
     x-text="number">
</div>    
<!-- ... -->
<script>
  function data(){
    return {
      number: '456',
      foo(num){
        alert(num);
      }
    }
  }
</script>
Delightful Donkey