Vue——Slot(插槽)
来源:互联网 发布:新西兰特卡波星空 知乎 编辑:程序博客网 时间:2024/06/06 10:42
使用方法
我们平常内容,都是在template里面定义的。
但在template里面使用slot
以后,可以直接在html的组件标签内写内容。
实例1
<div id = 'app'> <panel> nsdjkfn </panel></div><template id="panel-tpl"> <div class="panel"> <div class="title">这里是标题</div> <div class="content"> //我们在模版content里面插入了slot标签,使得我们可以在上面的panel标签内写内容 <slot></slot> </div> <div class="footer">更多信息</div> </div></template>
实例2
<div id = 'app'> <panel> //这里指定一下插槽的名字,即可以写内容 <div slot="content" > 内容。。。 </div> </panel></div><template id="panel-tpl"> <div class="panel"> <div class="title">这里是标题</div> <div class="content"> //我们指定slot的name <slot name = "content"></slot> </div> <div class="footer">更多信息</div> </div></template>
阅读全文
0 0
- Vue——Slot(插槽)
- vue slot插槽
- vue 插槽slot
- vue slot插槽的使用
- vue动态组件和slot插槽
- vue slot插槽的小技巧
- vue使用插槽分发内容slot的用法
- R-什么是slot插槽?
- vue组件——slot分发内容
- vue踩坑系列——slot
- Vue.js组件——slot杂记
- 【20】vue.js — slot占位符
- QT程序实例----信号与插槽(signal and slot)
- 计算机硬件—主板插槽
- Vue 插槽分发内容
- vue的匿名插槽
- vue的实名插槽
- Vue使用具名插槽细节
- ini操作
- Java进阶(八)内部类的浅析
- yum安装软件时报错libmysqlclient.so.18()(64bit)---Linux报错
- CSS 3基础样式
- 线程中调用service方法出错
- Vue——Slot(插槽)
- 使用servlet进行反射跳转
- 虚拟机(Vm12)+CentOS-7-x86_64-Minimal-1708 NAT模式 SecureCRT
- 公务员年度考核登记表
- 欢迎使用CSDN-markdown编辑器
- 获取当前工作目录
- 201709301525->untiy中打印导入资源
- boost库编译
- 被Idea欺负死了