Blogger Information
Blog 26
fans 0
comment 0
visits 21624
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
vue 模糊查询
default
Original
892 people have browsed it
  1. <template>
  2. <div>
  3. <input type="text" v-model="mytext">{{mytext}}
  4. <ul>
  5. <li v-for="(item,key) in app()" :key='key'>
  6. {{item}}
  7. </li>
  8. </ul>
  9. </div>
  10. </template>
  11. <script>
  12. export default {
  13. data(){
  14. return{
  15. mytext:'',
  16. datalist:['dasdd','dasda','gfadas','tadfvvc','cnbasm','pgionww'],
  17. newList:[]
  18. }
  19. },
  20. methods:{
  21. app(){
  22. return this.datalist.filter(item =>item.includes(this.mytext))
  23. // console.log(newList)
  24. }
  25. }
  26. }
  27. </script>
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post