hookehuyr

fix(PrivacyAgreementModal): 监听弹框显示状态以重置同意状态

添加watch监听visible属性变化,每次打开弹框时重置agreed状态
......@@ -83,7 +83,7 @@
</template>
<script setup>
import { ref, computed, defineEmits, defineProps } from 'vue'
import { ref, computed, watch, defineEmits, defineProps } from 'vue'
import Taro from '@tarojs/taro'
// Props
......@@ -100,6 +100,13 @@ const emit = defineEmits(['update:visible', 'confirm', 'cancel'])
// 响应式数据
const agreed = ref(false)
// 监听弹框显示状态,每次打开时重置agreed
watch(() => props.visible, (newVisible) => {
if (newVisible) {
agreed.value = false
}
})
// 计算属性
const modalVisible = computed({
get() {
......