抽离的子组件
<template>
  <div class="wrapper">
    <slot name="demo"  :msg="msg" text="this is a slot demo , ">this is demo slot.</slot>
  </div>
</template>

<script>
  export default {
    components: {},
    props: {},
    data() {
      return {
        msg: 'nmb'
      }
    },
    watch: {},
    computed: {},
    methods: {},
    created() {},
    mounted() {}
  }
</script>
<style lang="scss" scoped>
.wrapper {
}
</style>

  

某组件内使用抽离组件
   <father>
          <template v-slot:demo="scope">
            sb
            <p>{{ scope.text }}{{ scope.msg }}</p>
          </template>
        </father>

  

相关文章:

  • 2021-06-22
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2022-01-13
  • 2021-04-29
  • 2021-12-24
  • 2021-07-05
猜你喜欢
  • 2022-12-23
  • 2021-05-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案