SHARE
TWEET

Untitled

a guest Jun 20th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. new Vue ({
  2.       el: '#app',
  3.       delimiters: ['[[', ']]'],
  4.       data: {
  5.         search: '',
  6.         List : [
  7.         {% for item in items %}
  8.           {
  9.             "id" : "{{ item.id }}",
  10.            "name":  " {{ item.name }} "
  11.           },
  12.  
  13.         {% endfor %}
  14.     ]
  15.       },
  16.       computed: {
  17.         filteredProducts() {
  18.           // var lowerTitle = product.title.toLowerCase();
  19.           return this.List.filter((list) => {
  20.             return list.name.toLowerCase().match(this.search);
  21.           });
  22.         }
  23.       }
  24.     })
  25.      
  26. <div id="app">
  27.       <div class="search-wrapper">
  28.         <input type="text" v-model="search" placeholder="Search title.."/>
  29.  
  30.       </div>
  31.       <div class="wrapper">
  32.         <div class="card" v-for="item in filteredList" :key="list.id">
  33.  
  34.             [[ item.name ]]
  35.  
  36.  
  37.           </a>
  38.         </div>
  39.       </div>
  40.     </div>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top