import {
useStore
} from "vuex";
// import {
// useRouter
// } from 'vue-router'
export default {
setup() {
const store = useStore()
console.log(store)
// const router = useRouter()
async function loginToken() {
store.dispatch('user/login', {
loginName: '',
username: "",
passsword: ""
})
}
return {
loginToken
}
}
}
actions里定义的函数是login,dispatch写的是user/login