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

slot-scope  的意思通俗來說就是使用父的標籤,可是使用子的數據,具體看代碼:app <body> <div id="app"> <cpn> <template slot-scope="slots"> //slots 爲子插槽的名字,即name屬性 <span>{{slots.data}}</span>
相關文章
相關標籤/搜索