personal.vue 914 B

12345678910111213141516171819202122232425262728293031
  1. <template>
  2. <div>
  3. <div>个人用户首页</div>
  4. <v-btn color="primary" class="white--text mt-2" min-width="298" @click="changeRole">切换为企业用户</v-btn>
  5. <!-- 加入公司/新建公司 -->
  6. <Dialog :visible="show" :footer="true" title="企业注册" widthType="1">
  7. <enterpriseRegister ref="enterpriseRegisterRef"></enterpriseRegister>
  8. </Dialog>
  9. </div>
  10. </template>
  11. <script setup>
  12. import Dialog from '@/components/Dialog'
  13. import enterpriseRegister from '@/views/enterprise/components/register.vue'
  14. import { ref } from 'vue';
  15. defineOptions({ name:'personal-index'})
  16. import { useRouter } from 'vue-router'
  17. const router = useRouter()
  18. const userType = ref(1) // 0企业用户、1个人用户
  19. const show = ref(false)
  20. const changeRole = () => {
  21. if (userType.value) {
  22. show.value = true
  23. } else {
  24. router.push({ path: '/' })
  25. }
  26. }
  27. </script>
  28. <style lang="scss" scoped>
  29. </style>