favourites.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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/favourites',
  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 class="">
  21. <div class="py-18px px-24px bg-#FAFAFA b-rd-10px text-#000 text-20px fw-500 mb-20px">
  22. Favourites
  23. </div>
  24. <el-tabs v-model="activeName" class="favorite-tabs" @tab-click="handleClick">
  25. <el-tab-pane label="Products" name="products">
  26. <business-account-favourite-products :active-name="activeName" />
  27. </el-tab-pane>
  28. <el-tab-pane label="Brands" name="following">
  29. <business-account-favourite-brands :active-name="activeName" />
  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. ::v-deep(.el-tabs__header){
  41. .el-tabs__item{
  42. color: #333;
  43. &.is-active {
  44. color: #C58C64!important;
  45. }
  46. }
  47. .el-tabs__active-bar{
  48. background-color: #C58C64!important;
  49. }
  50. }
  51. }
  52. </style>