摘要: 1,var var是函数级别的作用域 2,let let是块级的作用域(花括号) let 不存在变量提升 阅读全文
posted @ 2024-02-15 20:17 学无边涯 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 父组件import {provide, ref} from 'vue' provide('data-key', 'this is room data')子组件 import { inject } from "vue"; const roomData = inject('data-key') 阅读全文
posted @ 2024-02-15 19:51 学无边涯 阅读(1) 评论(0) 推荐(0) 编辑
摘要: <template> <div> <h1>{{ message }}</h1> <button @click="btnclick">点击</button> </div> </template> <script> export default{ data(){ return{ message:'hel 阅读全文
posted @ 2024-02-15 10:08 学无边涯 阅读(2) 评论(0) 推荐(0) 编辑
摘要: app.vue <template> <h1>插槽知识</h1> <SmallSlot> <template #header> <div> <ul> <li>1</li> <li>2</li> <li>3</li> </ul> </div> </template> <template #main=" 阅读全文
posted @ 2024-02-15 10:00 学无边涯 阅读(4) 评论(0) 推荐(0) 编辑
摘要: vue 具名插槽slot 为插槽取名字 app.vue <template> <h1>插槽知识</h1> <SmallSlot> <template #header> <div> <ul> <li>1</li> <li>2</li> <li>3</li> </ul> </div> </templat 阅读全文
posted @ 2024-02-15 09:47 学无边涯 阅读(17) 评论(0) 推荐(0) 编辑
摘要: vue 插槽slot 父组件为子组件传递html结构 app.vue <template> <h1>插槽知识</h1> <SmallSlot> <div> <ul> <li>1</li> <li>2</li> <li>3</li> </ul> </div> </SmallSlot> </templa 阅读全文
posted @ 2024-02-15 09:40 学无边涯 阅读(2) 评论(0) 推荐(0) 编辑