vue 插槽及插槽做用域 slot slot-scope

slot-scope  的意思通俗来说就是使用父的标签,可是使用子的数据,具体看代码:app <body> <div id="app"> <cpn> <template slot-scope="slots"> //slots 为子插槽的名字,即name属性 <span>{{slots.data}}</span>
相关文章
相关标签/搜索