0
点赞
收藏
分享

微信扫一扫

作用域插槽 向父组件传递 <template slot-scope=

栖桐 2022-08-29 阅读 62

作用域插槽 向父组件传递 <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>
111 {{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"

父组件调用

<slot-test2>
<template slot-scope="{ kk }" slot="action">
666 {{kk}}
</template>
</slot-test2>

 

---------------------------------------------
生活的意义并不是与他人争高下,而在于享受努力实现目标的过程,结果是对自己行动的嘉奖。
↑面的话,越看越不痛快,应该这么说:

生活的意义就是你自己知道你要做什么,明确目标。没有目标,后面都是瞎扯!



举报

相关推荐

0 条评论