title: how to pass parameters in alpine js functions
body: <p>I trying to pass variable tab in showTab in x-for my code look like this</p>
  <pre><code>&lt;div x-data =&quot;tabs&quot;&gt;
  &lt;ul &gt;
  
    &lt;template x-for=&quot;tab in items&quot;&gt;
        &lt;li&gt;
          &lt;button @click=&quot;showtabs('tab')&quot;&gt;&lt;/button&gt;
  
          &lt;button x-text= &quot;tab&quot; @click=&quot;tab.current = 'second'&quot;&gt;&lt;/button&gt;
        &lt;/li&gt;
    &lt;/template&gt;
  &lt;/ul&gt;
  &lt;div x-show='current'&gt;
    fsfsdfds
  &lt;/div&gt;
  &lt;div x-show='current'&gt;
    nice
  &lt;/div&gt;
  </code></pre>
    
  <p>in my script below I want to pass parameters in showtab()</p>
  <pre><code>document.addEventListener('alpine:init', () =&gt; {
  Alpine.data('tabs', () =&gt; ({
      open: false,
      current: 'first',
      items: ['first', 'second'],
      showtabs(data_id){
  
        for(keys in items){
          var obj = items[keys]
          if(obj == data_id){
  
          }
        }
      }
  }))
  </code></pre>
  <p>})</p>