From b95fb364dfe3276e7a27b1568052a4307279e291 Mon Sep 17 00:00:00 2001 From: YuanHuakk <1751826683@qq.com> Date: Fri, 30 Aug 2024 13:22:42 +0800 Subject: [PATCH] feat(components): \! --- src/components/Popup.vue | 37 +++++++++++++++++++++---------------- src/pages/index/index.vue | 5 +++-- src/static/popTip.png | Bin 0 -> 177424 bytes 3 files changed, 24 insertions(+), 18 deletions(-) create mode 100644 src/static/popTip.png diff --git a/src/components/Popup.vue b/src/components/Popup.vue index 5eda46b..0df305b 100644 --- a/src/components/Popup.vue +++ b/src/components/Popup.vue @@ -2,15 +2,13 @@ import {ref} from 'vue'; import Taro from '@tarojs/taro'; -const show = ref(false); - -const overlay = ref(); +const isShow = ref(false); defineExpose({ - show, + isShow, }); -defineProps({ +const props = defineProps({ src: { required: true, type: String, @@ -18,29 +16,36 @@ defineProps({ }, type: Number, cb: { - required: true, - type: Function, - default: () => {}, + type: Function || null, + default: null, }, }); -Taro.useLoad(async () => { - if (Taro.getStorageSync('token')) show.value = true; - // const res = await getSignRecord() - // console.log(res) +const clickFn = type => { + if (props.cb) props.cb(type); + else isShow.value = false; +}; + +Taro.useLoad(() => { + if (Taro.getStorageSync('token')) isShow.value = true; });