H5中单选框能够正常点击,小程序中点击打勾后无法取消
tree.vue
<radio-group name="" @change="change" v-if="!mutilSelect">
<tree-dom :treeData="treeData" :isCheckbox="false"></tree-dom>
</radio-group>
methods: {
change(e) {
console.log(e.detail.value)
}
}
tree-dom.vue
<view class="">
<uni-collapse v-if="isFolder.length != 0">
<uni-collapse-item :title="item.name" v-for="(item,index) in isFolder" :key="index">
<view class="children" v-if="item.children.length != 0">
<tree-dom :treeData="item.children" :isCheckbox="isCheckbox"></tree-dom>
</view>
</uni-collapse-item>
</uni-collapse>
<view class="list" v-if="isLastLeaves.length != 0">
<view class="list-item" v-for="(child,childIndex) in isLastLeaves" :key="childIndex">
<label v-if="!isCheckbox">
<radio :value="`${child.id}-${child.name}`" :checked="child.isChecked" :id="child.name"/><text>{{child.name}}</text>
</label>
<label v-else>
<checkbox :value="`${child.id}-${child.name}`" :checked="child.isChecked" :id="child.name"/><text>{{child.name}}</text>
</label>
</view>
</view>
</view>
吴叫兽2333 (作者)
小程序中radio-group必须和radio在同一个vue文件吗
2021-11-30 21:17
吴叫兽2333 (作者)
看楼下简单的demo
2021-11-30 21:23
吴叫兽2333 (作者)
帮我再看一下这个问题,谢谢
2021-12-01 09:31