子组件:
<template>
<view @click="updateTap">testettsts</view>
</template>
<script>
export default {
props: ['shouldShow'],
data() {
return {};
},
methods: {
updateTap() {
console.log(1111);
this.$emit('update:shouldShow', !this.shouldShow);
},
},
};
</script>
父组件:
<template>
<test-com :should-show.sync="shouldShowSpec"></test-com>
</template>
<script>
export default {
data() {
return {
shouldShowSpec: false,
};
},
};
</script>
3 个回复
DCloud_UNI_LXH
DCloud_UNI_LXH
bug已确认,已加分,预计下版修复
https://github.com/dcloudio/uni-app/issues/2774
DCloud_UNI_GSQ
HBuilderX alpha 3.2.5+ 已修复