作用域插槽 向父组件传递 <template slot-scope="{ row, index }" slot="dateNo">
slotTest1
<slot name="action" :kk="kk"></slot>
slotTest2
<!--
* @description text
!-->
<template>
<div>
<slot-test1>
<template slot-scope="{ kk }" slot="action">
<slot name="action" :kk="kk"></slot>
{{kk}}
</template>
</slot-test1>
</div>
</template> <script>
import slotTest1 from './slotTest1'
export default {
name: 'slotTest',
components: {
slotTest1
},
props: {},
data () {
return {}
},
watch: {},
computed: {},
methods: {},
created () {
},
mounted () {
}
}
</script>
<style lang="less" scoped>
</style>
父组件调用
<slot-test2>
<template slot-scope="{ kk }" slot="action">
{{kk}}
</template>
</slot-test2>