settings.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <script lang='ts' setup>
  2. const activeName = ref()
  3. const router = useRouter()
  4. const route = useRoute()
  5. function handleClick(tab: any) {
  6. const tabName = tab.paneName
  7. activeName.value = tabName
  8. router.push({
  9. path: '/account/settings',
  10. query: {
  11. tab: tabName,
  12. },
  13. })
  14. }
  15. onMounted(() => {
  16. activeName.value = route.query.tab as string
  17. })
  18. </script>
  19. <template>
  20. <div>
  21. <div class="py-18px px-24px bg-#FAFAFA b-rd-10px text-#000 text-20px fw-500 mb-20px">
  22. Settings
  23. </div>
  24. <el-tabs v-model="activeName" class="favorite-tabs" @tab-click="handleClick">
  25. <el-tab-pane label="My Profile" name="profile">
  26. <Business-account-settings-profile v-if="activeName === 'profile'" />
  27. </el-tab-pane>
  28. <el-tab-pane label="Change Password" name="password">
  29. <Business-account-settings-changePsw v-if="activeName === 'password'" />
  30. </el-tab-pane>
  31. </el-tabs>
  32. </div>
  33. </template>
  34. <style lang='less' scoped>
  35. .favorite-tabs {
  36. background-color: #FAFAFA;
  37. border-radius: 10px;
  38. padding: 20px;
  39. padding-top: 0px;
  40. .el-tab-pane{
  41. display: flex;
  42. justify-content: center;
  43. padding: 60px 0;
  44. }
  45. ::v-deep(.el-tabs__header){
  46. .el-tabs__item{
  47. color: #333;
  48. &.is-active {
  49. color: #C58C64!important;
  50. }
  51. }
  52. .el-tabs__active-bar{
  53. background-color: #C58C64!important;
  54. }
  55. }
  56. }
  57. </style>