index.vue 672 B

1234567891011121314151617181920212223242526272829303132
  1. <template>
  2. <div class='full-height'>
  3. <el-button @click='push'>确定</el-button>
  4. </div>
  5. </template>
  6. <script>
  7. import useCounterStore from '../../store/user.js'
  8. import tokenStore from '../../store/token.js'
  9. import { setToken } from '../../utils/auth.js'
  10. export default {
  11. setup () {
  12. const store = useCounterStore()
  13. const token = tokenStore()
  14. return { store, token }
  15. },
  16. created () {
  17. console.log(this.store.info.name)
  18. console.log(this.token.value)
  19. setToken('asfddas129rq34-rda')
  20. },
  21. methods: {
  22. push () {
  23. this.$router.push({ path: '/setting', query: { id: 12, type: 'test' } })
  24. }
  25. }
  26. }
  27. </script>
  28. <style scoped>
  29. </style>