摘要: 阅读全文
posted @ 2022-08-22 15:00 杨建鑫 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 父组件 : <template> <div class="app"> <tab-control :titles="['衣服', '鞋子', '裤子']" @tab-item-click="tabItemClick"> <template v-slot="props"> <button>{{ prop 阅读全文
posted @ 2022-08-22 14:39 杨建鑫 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 父组件 : <template> <!-- nav-bar只给一个插槽动态传入数据 --> <nav-bar> <template v-slot:[position]> <a href="#">注册</a> </template> </nav-bar> <button @click=" positi 阅读全文
posted @ 2022-08-22 14:31 杨建鑫 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 父组件 : <template> <nav-bar> <template #left> <button>{{ leftText }}</button> </template> <template #center> <span>内容</span> </template> <template v-slo 阅读全文
posted @ 2022-08-22 14:27 杨建鑫 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 父组件 : <template> <div class="app"> <!-- 1.内容是button --> <show-message title="哈哈哈"> <button>我是按钮元素</button> </show-message> <!-- 2.内容是超链接 --> <show-mes 阅读全文
posted @ 2022-08-22 14:24 杨建鑫 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 父组件 : <template> <div class="app"> <h2>当前计数: {{ counter }}</h2> <!-- 1.自定义add-counter, 并且监听内部的add事件 --> <add-counter @add="addBtnClick"></add-counter> 阅读全文
posted @ 2022-08-22 14:20 杨建鑫 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 父组件 : <template> <div class="app"> <h2>当前计数: {{ counter }}</h2> <!-- 并且监听内部的sub事件 --> <sub-counter @sub="subBtnClick"></sub-counter> </div> </template 阅读全文
posted @ 2022-08-22 14:17 杨建鑫 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 父组件 : <template> <!-- 如果当前的属性是一个非prop的attribute, 那么该属性会默认添加到子组件的根元素上 --> <show-info name="why" :age="18" :height="1.88" address="广州市" abc="cba" class= 阅读全文
posted @ 2022-08-22 12:01 杨建鑫 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 父组件 : <template> <!-- 1.展示why的个人信息 --> <show-info name="why" :age="18" :height="1.88" /> </template> <script> import ShowInfo from './ShowInfo.vue' ex 阅读全文
posted @ 2022-08-22 11:46 杨建鑫 阅读(55) 评论(0) 推荐(0) 编辑
摘要: 父组件 : <template> <!-- 1.展示why的个人信息 --> <show-info name="why" :age="18" :height="1.88" address="广州市" abc="cba" class="active" /> </template> <script> i 阅读全文
posted @ 2022-08-22 11:37 杨建鑫 阅读(241) 评论(0) 推荐(0) 编辑