页面
<template>
<view>
<view v-for="item in list[c]" :key="item.id">
<test v-if="[1,2].includes(item.id)">{{item.id}}</test>
</view>
<button @click="click">change</button>
</view>
</template>
<script>
import test from './components/test'
export default {
components: {test},
data() {
return {
c: 0,
list: [[{id:1}],[{id:2}]],
}
},
methods: {
click() {
this.c = this.c == 0 ? 1 : 0
}
}
}
</script>
test组件
<template>
<view>
test-<slot></slot>
</view>
</template>
<script>
export default {
data() {
console.log('test in data')
return {}
}
}
</script>
2 个回复
FullStack - 【插件开发】【专治疑难杂症】【ios上架、马甲包、白包、过审、已成功上架过几百个】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=22130】【非诚勿扰】QQ:543610866
提供可以复现的demo,方便排查
DCloud_UNI_GSQ
问题确认,已加分,后续修复。
临时处理办法: