以下仅为个人理解,若有不妥请留言评论区
v-slot 指令自 Vue 2.6.0 起被引入,在接下来所有的 2.x 版本中 slot 和 slot-scope attribute 仍会被支持,但已经被官方废弃且不会出现在 Vue 3 中
| slot | 1.用于设置标签的属性值(slot=“title”), 2.用于设置标签文本显示的位置(slot=“header”) |
|---|---|
| slot-scope | 作用域插槽,绑定的是子组件的数据 |
| v-slot | 1.取代了slot,slot-scope 2.只能添加在上,(只有一种情况例外) |
- slot
- slot-scope
- v-slot
{{ navMenu.name }}
slot-scope取 消 确 定
v-slot{{scope.row.modifyTime|formtterDate}}
//v-slot定义作用域插槽 {{scope.msg}}



