setting.vue 798 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <!-- 设置 -->
  2. <template>
  3. <view class="setting">
  4. <u-cell-group>
  5. <u-cell-item icon="setting-fill" title="退出登录" @click=" logoutModal = true"></u-cell-item>
  6. </u-cell-group>
  7. <!-- 退出登录提示框 -->
  8. <u-modal
  9. v-model="logoutModal"
  10. width="70%"
  11. @confirm="logout"
  12. content="您确认退出登录吗?"
  13. :show-cancel-button="true"
  14. />
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. name: 'Setting',
  20. data() {
  21. return {
  22. // 登出提示框
  23. logoutModal: false
  24. }
  25. },
  26. methods: {
  27. /**
  28. * 退出登录
  29. */
  30. logout() {
  31. this.$u.vuex('vuex_hasLogin', false);
  32. this.$u.vuex('vuex_token', '');
  33. this.$u.vuex('vuex_user', '');
  34. this.$u.route('/pages/phoneLogin/phoneLogin');
  35. }
  36. }
  37. }
  38. </script>
  39. <style lang="scss" scoped>
  40. </style>