title: Vue JS v-for filter by unique
body: <p>My company is moving from Angular JS to Vue. It has been very smooth until I needed to replicate the functionailty of an Angular filter into VueJS. The original Angular filter looked like so:</p>
  
  <p>JS</p>
  
  <pre><code>app.filter('unique', function () {
      return function (collection, keyname) {
          var output = [],
              keys = [];
  
          angular.forEach(collection, function (item) {
              var key = item[keyname];
              if (keys.indexOf(key) === -1) {
                  keys.push(key);
                  output.push(item);
              }
          });
  
          return output;
      };
  });
  </code></pre>
  
  <p>In my Vue I have the following:</p>
  
  <pre><code>&lt;select class="u-full-width" v-model="newPost.cat"&gt;
     &lt;option value="" selected="selected"&gt;Choose a Category&lt;/option&gt;
     &lt;option v-for="post in posts | unique" selected&gt;{{ post.cat }}&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>I assume I can still use filters the same, but how do I go about replicating this?</p>