<script lang="ts" setup>
|
import { onMounted,computed } from 'vue'
|
import { ajaxGet } from '@/utils/axios'
|
import { useCounterStore } from '@/stores/counter'
|
import {useRoute} from 'vue-router'
|
const router = useRoute()
|
const counter = useCounterStore()
|
const data={
|
name:'cheng',
|
age:18
|
}
|
// counter.count++
|
const count=computed(()=>{
|
return counter.count
|
})
|
const add=()=>{
|
counter.increment()
|
}
|
const shao=()=>{
|
}
|
onMounted(() => {
|
console.log('初始化',router)
|
const queryInfo=router.query
|
const {code}=queryInfo
|
console.log(code)
|
if (code){
|
ajaxGet('wechat/code',{code}).then((re:any)=>{
|
console.log(re)
|
})
|
}
|
})
|
|
</script>
|
|
<template>
|
<div class="HomePage"></div>
|
</template>
|