index.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <!-- -->
  2. <template>
  3. <div class='con'>
  4. <div class="logo">
  5. <vcenter>
  6. <img :src="require('@/assets/images/index_logo@2x.png')" alt="">
  7. </vcenter>
  8. </div>
  9. <div class="setting">
  10. <vcenter>
  11. <div>
  12. <i class="iconfont icon-zhuxiao"></i>
  13. <span @click="logout">注销</span>
  14. </div>
  15. </vcenter>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. // 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  21. // 例如:import 《组件名称》 from '《组件路径》';
  22. import vcenter from '@/components/vcenter'
  23. export default {
  24. // import引入的组件需要注入到对象中才能使用
  25. components: {vcenter},
  26. data () {
  27. // 这里存放数据
  28. return {
  29. }
  30. },
  31. // 监听属性 类似于data概念
  32. computed: {},
  33. // 监控data中的数据变化
  34. watch: {},
  35. // 方法集合
  36. methods: {
  37. logout () {
  38. window.localStorage.setItem('zfb_token', '')
  39. this.$token = ''
  40. this.$alert('退出成功', '提示', {
  41. confirmButtonText: '确定',
  42. callback: action => {
  43. this.$router.push('/login')
  44. }
  45. })
  46. }
  47. },
  48. // 生命周期 - 创建完成(可以访问当前this实例)
  49. created () {
  50. },
  51. // 生命周期 - 挂载完成(可以访问DOM元素)
  52. mounted () {
  53. },
  54. beforeCreate () {}, // 生命周期 - 创建之前
  55. beforeMount () {}, // 生命周期 - 挂载之前
  56. beforeUpdate () {}, // 生命周期 - 更新之前
  57. updated () {}, // 生命周期 - 更新之后
  58. beforeDestroy () {}, // 生命周期 - 销毁之前
  59. destroyed () {}, // 生命周期 - 销毁完成
  60. activated () {} // 如果页面有keep-alive缓存功能,这个函数会触发
  61. }
  62. </script>
  63. <style lang="scss" scoped>
  64. @import './style.scss';
  65. </style>