vue中slot和template用法传值

1 父页面调用assets-trend子组件,并接受assets-trend子组件传来的参数

<assets-trend style="flex: 2.7">
              <template slot-scope="slot">
                {
   {
   slot.slotMsg}}
               
              </template>
            </assets-trend>

2 子页面assets-trend使用slot传值

 <div>
    <template slot="title-tool">
      <slot slotMsg="这是子页面的信息"></slot>
    </template>
</div>

相关推荐

  1. vueslottemplate用法

    2024-01-12 00:44:03       62 阅读
  2. vuetemplate原理

    2024-01-12 00:44:03       45 阅读
  3. vue父子组件

    2024-01-12 00:44:03       58 阅读
  4. vue3使用mitt用于组件之间

    2024-01-12 00:44:03       55 阅读
  5. 深入了解Vueslot的应用

    2024-01-12 00:44:03       33 阅读
  6. 【BUG】vue@change时间丢失问题

    2024-01-12 00:44:03       37 阅读
  7. Vue3父子组件的问题

    2024-01-12 00:44:03       32 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-12 00:44:03       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-12 00:44:03       106 阅读
  3. 在Django里面运行非项目文件

    2024-01-12 00:44:03       87 阅读
  4. Python语言-面向对象

    2024-01-12 00:44:03       96 阅读

热门阅读

  1. 【K8S环境搭建】

    2024-01-12 00:44:03       49 阅读
  2. yum命令报错解决

    2024-01-12 00:44:03       67 阅读
  3. GFS 分布式文件系统

    2024-01-12 00:44:03       46 阅读
  4. leetcode-相同的树

    2024-01-12 00:44:03       66 阅读
  5. RT-Thread入门笔记2-动态内存堆的使用

    2024-01-12 00:44:03       60 阅读
  6. 大模型学习第四课

    2024-01-12 00:44:03       54 阅读
  7. SDKMAN的安装与卸载

    2024-01-12 00:44:03       57 阅读