index.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <div class='full-width full-height flex flex-col flex-justify-start'>
  3. <div>
  4. <el-button @click='push'>设置</el-button>
  5. {{data}}
  6. </div>
  7. <div v-for='item in list' :key='item.id' class='mt-20'>
  8. <button >{{item.title}}</button>
  9. </div>
  10. </div>
  11. </template>
  12. <route>
  13. {
  14. name: '设置',
  15. }
  16. </route>
  17. <script>
  18. import useCounterStore from '../../store/user.js'
  19. export default {
  20. name: 'index',
  21. setup () {
  22. const user = useCounterStore()
  23. return { user }
  24. },
  25. data () {
  26. return {
  27. list: [],
  28. data: null
  29. }
  30. },
  31. created () {
  32. this.init()
  33. },
  34. methods: {
  35. init () {
  36. this.user.info = { user: '123', name: 'holle' }
  37. this.data = this.$route.query
  38. this.user.$dispose()
  39. this.$api.login.sendSMS({ current: 1, size: 200 }).then((res) => {
  40. if (res.code === 200) {
  41. this.list = res.data.records
  42. }
  43. })
  44. },
  45. push () {
  46. this.$router.push({ path: '/user', query: { id: 12, type: 'test' } })
  47. }
  48. }
  49. }
  50. </script>
  51. <style scoped>
  52. </style>