title: Using @click in select options - Vue.js 2
body: <p>I'd like to use @click in select options.</p>
  
  <p>So far I have:</p>
  
  <pre><code>&lt;button @click="sortBy('name')"&gt;sort by name&lt;/button&gt;
  &lt;button @click="sortBy('price')"&gt;sort by price&lt;/button&gt;
  </code></pre>
  
  <p>and it works, however when I insert it into option tag, it stopped working.</p>
  
  <pre><code>&lt;select name="sortBy" id="sortBy"&gt;
    &lt;option value="sort"&gt;sort By&lt;/option&gt;
    &lt;option @click="sortBy('name')"&gt;name&lt;/option&gt;
    &lt;option @click="sortBy('price')"&gt;price&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>My function:</p>
  
  <pre><code>sortBy(sortKey) {
      this.items.sort((a, b) =&gt;
      (typeof a[sortKey] === 'string' || typeof b[sortKey] === 'string') ? 
      a[sortKey].localeCompare(b[sortKey]) : a[sortKey] - b[sortKey]);
  }
  </code></pre>