久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁技術(shù)文章
文章詳情頁

Vue+Vant實現(xiàn)頂部搜索欄

瀏覽:7日期:2022-09-29 08:15:01

本文實例為大家分享了Vue+Vant實現(xiàn)頂部搜索欄的具體代碼,供大家參考,具體內(nèi)容如下

搜索欄組件源碼(SearchBar.vue)

<template> <section class='city-search'> <van-icon name='search' /> <input placeholder='在此輸入檢索關(guān)鍵字' v-model='KeyWord'> <van-icon name='clear' v-show='KeyWord' @click='clearSearchInput' /> </section></template> <script>export default { data() {return { KeyWord: ’’,} }, methods: {clearSearchInput() { this.KeyWord = ’’;} }}</script> <!-- Add 'scoped' attribute to limit CSS to this component only --><style> .city-search {background-color: #F7F8FA;display: flex;justify-content: flex-start;align-items: center;height: 2.3rem;width: 94vw;margin: 2vw 4vw;border-radius: 8px; } .search-icon { margin-left: 5px; } input { margin: 0 1.5vw; background-color: #F7F8FA; border: 0px; font-size: 14px; flex: 1 } .clear-icon { color: #999;} </style>其他組件依賴引用檢索組件

首頁引用搜索組件:

<template> <div> <search></search>首頁 </div></template> <script>import Search from ’@/components/SearchBar’export default { name: 'home', components: { ’search’: Search, },}</script> <!-- Add 'scoped' attribute to limit CSS to this component only --><style> </style>

效果截圖:

Vue+Vant實現(xiàn)頂部搜索欄

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持好吧啦網(wǎng)。

標(biāo)簽: Vue
相關(guān)文章:
主站蜘蛛池模板: 徐汇区| 简阳市| 竹北市| 海丰县| 澄迈县| 泊头市| 株洲县| 板桥市| 来凤县| 大方县| 石泉县| 高州市| 探索| 白河县| 东城区| 司法| 叶城县| 禄劝| 泌阳县| 泽库县| 合阳县| 昆明市| 旌德县| 黎川县| 卢氏县| 鄂托克前旗| 萍乡市| 射洪县| 鹰潭市| 红河县| 塔河县| 高雄县| 阜阳市| 电白县| 成武县| 石林| 绵竹市| 平凉市| 江阴市| 古浪县| 淮滨县|