码迷,mamicode.com
首页 > 其他好文 > 详细

作用域插槽 向父组件传递 <template slot-scope="{ row, index }" slot="dateNo">

时间:2019-05-16 19:06:50      阅读:2259      评论:0      收藏:0      [点我收藏+]

标签:action   created   ted   color   lang   组件   from   nts   compute   

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

父组件调用

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

 

作用域插槽 向父组件传递 <template slot-scope="{ row, index }" slot="dateNo">

标签:action   created   ted   color   lang   组件   from   nts   compute   

原文地址:https://www.cnblogs.com/pengchenggang/p/10877404.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!