zhangtianyi0110 / vuelearnnotes Goto Github PK
View Code? Open in Web Editor NEWVue学习笔记
License: MIT License
Vue学习笔记
License: MIT License
导航的四个tab-item,不同只是文字,图片路径,所以我就试了下v-for
<tab-bar> <template v-slot:tab-item> <tab-bar-item v-for="(item,index) in tabItem" :key='index'> <template v-slot:tab-img> <img :src="item.imgSrc" alt /> </template> <template v-slot:tab-img-active> <img :src="item.imgActiveSrc" alt /> </template> <template v-slot:tab-text> <div>{{item.name}}</div> </template> </tab-bar-item> </template> </tab-bar>
//数据部分
data(){ return { tabItem: [ { name: '首页', imgSrc: './assets/img/home.svg', imgActiveSrc: './assets/img/home-active.svg' }, { name: '分类', imgSrc: './assets/img/cate.svg', imgActiveSrc: './assets/img/cate-active.svg' }, { name: '购物车', imgSrc: './assets/img/cart.svg', imgActiveSrc: './assets/img/cart-active.svg' }, { name: '我的', imgSrc: './assets/img/admine.svg', imgActiveSrc: './assets/img/admine-active.svg' }, ] } }
但是很遗憾的是v-for把图片路径渲染到img的src上面之后,页面好像不对svg图片进行渲染了,也不显示图片了
coderwhy老师果然很厉害我在第一层,老师已经在第五层了。
希望有大佬试一下用v-for做一下,解答一下我的疑惑
[学习请教]-请问这个有原始资料吗,看了大佬的总结,挺有收获的,希望能通过一手资料,自己再理解一遍。
第20行
<input type="text" @click.enter="keyup">
应该是
<input type="text" @keyup.enter="keyup">
这个地方监听的是键盘输入而不是鼠标点击
综合练习不能正常移除
remove需要传入参数index
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.