2023年2月16日

插件使用

摘要: app.vue <template> <div> <Student/> <School></School> </div> </template> <!-- 1.插件,增强vue 本质:包含install的一个对象,install的第一个参数是vue,第二个以后的参数是插件使用者传递的 定义插件(在p 阅读全文

posted @ 2023-02-16 21:12 爱前端的小魏 阅读(35) 评论(0) 推荐(0) 编辑

main(调用一个公共组件)

摘要: app.vue <template> <div> <Student/> <School></School> </div> </template> <!-- 1.作用(mixin):将多个组件内相同的方法提取到一个混合对象 2.如何使用: 全局使用:在main.js中进行使用: import {混合变 阅读全文

posted @ 2023-02-16 21:09 爱前端的小魏 阅读(29) 评论(0) 推荐(0) 编辑

传递数据(props)

摘要: student.vue <template> <div> <h3>{{msg}}</h3> <h3>姓名:{{name}}</h3> <h3>年龄:{{myage}}</h3> <h3>性别:{{sex}}</h3> <button @click="add">点击我,年龄++</button> </ 阅读全文

posted @ 2023-02-16 21:05 爱前端的小魏 阅读(58) 评论(0) 推荐(0) 编辑

ref(代替id)

摘要: App.vue <template> <div> <Student ref="str"/> <h3 v-text="age" ref="age"></h3> <button @click="show()">点击button,输出年龄</button> </div> </template> <!-- 阅读全文

posted @ 2023-02-16 21:02 爱前端的小魏 阅读(101) 评论(0) 推荐(0) 编辑

Scoped方法(防止样式名称冲突)

摘要: App.vue <template> <div> <Student/> <School></School> </div> </template> <!-- 1.解决标签名称一样,引起样式冲突问题 写法:1.<style scoped></style> <style lang='css'></styl 阅读全文

posted @ 2023-02-16 21:00 爱前端的小魏 阅读(30) 评论(0) 推荐(0) 编辑

导航