匿名插槽
父组件:
<slot-comp>
<h2>
孩子给你一个礼物A
</h2>
</slot-comp>
子组件:
<div> <slot></slot> </div>
具名插槽:
![](https://img.haomeiwen.com/i27341677/a134fb6e2d006ae3.png)
![](https://img.haomeiwen.com/i27341677/bd0c0326da8870af.png)
![](https://img.haomeiwen.com/i27341677/8ac178aac6c9d147.png)
在elementui实战中的运用:
![](https://img.haomeiwen.com/i27341677/161d918a3d3635ac.png)
vue2.6之后就出现了 v-slot 在vue3 就必须使用v-slot
v-slot只能写在template上
![](https://img.haomeiwen.com/i27341677/e87dd1acafa53d39.png)
VUEX基本详情
![](https://img.haomeiwen.com/i27341677/31827318df151507.png)
修改状态
![](https://img.haomeiwen.com/i27341677/4839f63f773543f0.png)
vue-devtools的使用
状态跟踪以及回溯
![](https://img.haomeiwen.com/i27341677/de930ef3bcca0d52.png)
匿名插槽
父组件:
<slot-comp>
<h2>
孩子给你一个礼物A
</h2>
</slot-comp>
子组件:
<div> <slot></slot> </div>
具名插槽:
在elementui实战中的运用:
vue2.6之后就出现了 v-slot 在vue3 就必须使用v-slot
v-slot只能写在template上
VUEX基本详情
修改状态
vue-devtools的使用
状态跟踪以及回溯
本文标题:vue中的组件插槽和vuex的使用
本文链接:https://www.haomeiwen.com/subject/teivqrtx.html
网友评论