slot
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
[[Vue]]
&color(red){※前提条件:本文基于 Vue 2.0 创作};
#contents
* slot [#z4c6fbbc]
插槽,也就是slot,是组件的一块HTML模板,这块模板显示不显...
由于插槽是一块模板,所以,对于任何一个组件,从模板种类的...
- 非插槽模板指的是html模板,指的是‘div、span、ul、table’...
- 插槽模板是slot,它是一个空壳子,因为它显示与隐藏以及最...
* slot-scope [#xf412aed]
&color(red){在 2.6.0 中,我们为具名插槽和作用域插槽引入了...
取得作用域插槽:data绑定的数据,scope可以随便替换其他名称...
slot-scope="scope"
总的来说就是 scope-slot就是可以用子组件里面的数据, 可以操...
而scope-slot后面接的内容就是个别名, 或者说变量也行, 是指...
scope.row相当于一个{},{}里边都是数据;按理说,列表里的数...
#codeprettify{{
<el-table :data="tableData"
... 省略 ...>
<el-table-column prop="del_flg" label="标识">
<template slot-scope="scope">
\{\{ scope.row.end_flg == '1' ? 'Yes' : 'No' \}\}
</template>
</el-table-column>
... 省略 ...
data() {
return {
tableData: [{
date: '2020-08-09',
name: '张三',
del_flg: 1
},{
date: '2021-06-07',
name: '赵四',
del_flg: 0
},]
}}
#hr();
コメント:
#comment_kcaptcha
終了行:
[[Vue]]
&color(red){※前提条件:本文基于 Vue 2.0 创作};
#contents
* slot [#z4c6fbbc]
插槽,也就是slot,是组件的一块HTML模板,这块模板显示不显...
由于插槽是一块模板,所以,对于任何一个组件,从模板种类的...
- 非插槽模板指的是html模板,指的是‘div、span、ul、table’...
- 插槽模板是slot,它是一个空壳子,因为它显示与隐藏以及最...
* slot-scope [#xf412aed]
&color(red){在 2.6.0 中,我们为具名插槽和作用域插槽引入了...
取得作用域插槽:data绑定的数据,scope可以随便替换其他名称...
slot-scope="scope"
总的来说就是 scope-slot就是可以用子组件里面的数据, 可以操...
而scope-slot后面接的内容就是个别名, 或者说变量也行, 是指...
scope.row相当于一个{},{}里边都是数据;按理说,列表里的数...
#codeprettify{{
<el-table :data="tableData"
... 省略 ...>
<el-table-column prop="del_flg" label="标识">
<template slot-scope="scope">
\{\{ scope.row.end_flg == '1' ? 'Yes' : 'No' \}\}
</template>
</el-table-column>
... 省略 ...
data() {
return {
tableData: [{
date: '2020-08-09',
name: '张三',
del_flg: 1
},{
date: '2021-06-07',
name: '赵四',
del_flg: 0
},]
}}
#hr();
コメント:
#comment_kcaptcha
ページ名: