將watch移出onMounted

main
Wayne 2 years ago
parent e7a0d071ce
commit 8a4ac9e844

@ -45,7 +45,7 @@ const cusCardInfo = computed(() => {
// return cardStore.vipCard;
// });
onBeforeMount(async () => {
onMounted(async () => {
// console.log('liff',liff)
await liff.init({ liffId: import.meta.env.VITE_APP_LINE_LIFF_ID });
@ -60,8 +60,6 @@ onBeforeMount(async () => {
}
})
onMounted(async () => {
//tab
watch(() => activeName.value, function (newVal, oldVal) {
@ -83,8 +81,6 @@ onMounted(async () => {
showFlex('0')
})
})
async function showFlex(id) {
switch (id) {
@ -155,6 +151,7 @@ const sendEcard = async () => {
let content = JSON.parse(JSON.stringify(state.value.flexContent))
console.log('content', JSON.stringify(state.value.flexContent))
let res
if (activeName.value === '0') {
@ -324,6 +321,7 @@ const changeTpl = async (val) => {
.tpl-item {
width: 150px;
padding: 10px;
img {
width: 100%;
}

Loading…
Cancel
Save