vue實(shí)現(xiàn)帶放大鏡的搜索框
本文實(shí)例為大家分享了vue實(shí)現(xiàn)帶放大鏡的搜索框,供大家參考,具體內(nèi)容如下
字體圖標(biāo)在input單標(biāo)簽中的用法:
第一步,先在main.js 中全局引入iconfont圖標(biāo);第二步,給input 標(biāo)簽動(dòng)態(tài)綁定一個(gè)屬性,設(shè)置值為data中的變量;第三步,將字體圖標(biāo)代碼中的 &#x 改為 u
代碼如下:
<template> <div class='login'><!--頭部搜索 --> <div class='top'> <div class='top-text iconfont'>廣州</div> <div class='top-btn'> <input type='text' :placeholder='icon' class='iconfont'> </div> <div class='top-x iconfont iconlingdang1'></div> </div> </div></template><script> export default {name:'Login',data(){ return { icon:’ue637 請(qǐng)輸入關(guān)鍵詞’ }} }</script><style scoped> .login{width: 100%;height: 100%; } .top{width: 100%;height: 0.8rem;background-color: pink;display:flex;align-items: center;font-size:0.35rem; } .top-text{margin-left:0.3rem; } .top-btn{width: 4.8rem;height: 0.5rem;margin-left:0.2rem;margin-right:0.55rem; } .top-btn>input{width: 100%;height:0.5rem;border-radius:1rem;border:none;outline: none;padding-left:0.3rem; }</style>
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持好吧啦網(wǎng)。
相關(guān)文章:
1. XML入門的常見(jiàn)問(wèn)題(三)2. XML基本概念XPath、XSLT與XQuery函數(shù)介紹3. WML的簡(jiǎn)單例子及編輯、測(cè)試方法第1/2頁(yè)4. el-input無(wú)法輸入的問(wèn)題和表單驗(yàn)證失敗問(wèn)題解決5. 關(guān)于html嵌入xml數(shù)據(jù)島如何穿過(guò)樹(shù)形結(jié)構(gòu)關(guān)系的問(wèn)題6. CSS3實(shí)例分享之多重背景的實(shí)現(xiàn)(Multiple backgrounds)7. 不要在HTML中濫用div8. vue實(shí)現(xiàn)復(fù)制文字復(fù)制圖片實(shí)例詳解9. XML入門的常見(jiàn)問(wèn)題(四)10. 前端html+css實(shí)現(xiàn)動(dòng)態(tài)生日快樂(lè)代碼
