Open frankcou opened 6 months ago
关于 glass-easel 框架,目前还未单独处理,你可以尝试自行启用和验证。
3503 反馈的问题,以及讨论中所涉及的版本和修复都是针对 vue2 的。从你回答中提到的版本号判断,你可能使用的是 vue3 的需要另行排查。
确实是使用的vue3。不知道我不使用cli,直接使用HBuilder会不会就不会有这个问题?@zhetengbiji
3503 反馈的问题,以及讨论中所涉及的版本和修复都是针对 vue2 的。从你回答中提到的版本号判断,你可能使用的是 vue3 的需要另行排查。
确实是使用的vue3。不知道我不使用cli,直接使用HBuilder会不会就不会有这个问题?
如果对版本无明确的要求可以直接执行 npx @dcloudio/uvm@latest
升级到最新版 。
如果升级后仍然存在该问题,可以详细描述一下,方便验证和排查。
首页 pages/index.vue
<template>
<view class="page content">
<parent>
<template v-slot:parentslot="{ item }">
<view> {{ item }} </view>
</template>
</parent>
</view>
</template>
<script setup lang="ts">
import { onMounted, ref } from "vue";
import parent from "@/components/parent/parent.vue";
defineOptions({
multipleSlots: true,
dynamicSlots: true,
});
</script>
组件components/parent/parent.vue
<template>
<view class="parent">
<child>
<template v-slot:childslot="{ item }">
<slot name="parentslot" :item="item"></slot>
</template>
</child>
</view>
</template>
<script setup lang="ts">
import child from "./child.vue";
</script>
组件components/parent/child.vue
<template>
<view class="child">
<view v-for="item in arr" :key="item">
<slot name="childslot" :item="item"></slot>
</view>
</view>
</template>
<script setup lang="ts">
import { ref } from "vue";
const arr = ref([1, 2, 3]);
</script>
[Component] More than one slot named "parentslot" are found inside a single component instance (in component "components/parent/parent"). The first one was accepted.
<view class="page content data-v-83a5a03c">
<parent class="data-v-83a5a03c" u-s="{{['parentslot']}}" u-i="83a5a03c-0" bind:__l="__l">
<view wx:for="{{a}}" wx:for-item="v0" wx:key="b" slot="{{v0.c}}">
<view class="data-v-83a5a03c">{{v0.a}}</view>
</view>
</parent>
</view>
@zhetengbiji
楼主解决了没,同样的问题
正常嵌套两层slot展示正常,如果第三层slot展示有问题,只展示最后那个循环的数据
问题描述 v-for + slot会出现大量警告以及无法正常渲染。
我尝试过
npx @dcloudio/uvm@latest 2.0.2-3071120230427001
,出现Invalid version: 2.0.2-3071120230427001
(也就是说没这个版本了)查了npm上的版本,甚至尝试过3.0.0-alpha-4000020231227002这个最新版本,依然无法解决问题
补充信息