" type="hidden"/>

作用域插槽 向父組件傳遞


作用域插槽 向父組件傳遞 <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>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM