將watch移出onMounted

main
Wayne 2 years ago
parent e7a0d071ce
commit 8a4ac9e844

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

Loading…
Cancel
Save