- Mock adapter implementing @vmall/shared ApiClient (localStorage-persisted cart/orders/invoices), runtime switch via mockApi flag (default on) - Fixed bilingual mock catalog: 3-level categories, 24 products w/ SKUs, stores, brands, banners, floors, seckill/collective/integral, comments, coupons, addresses, seeded orders/shipments/invoices - B2B2C mall shell: top bar, logo/search/cart header, dark nav + category mega-menu, value-prop footer, back-to-top; 1200px grid, #ca151e theme - UI primitives replacing element-plus: carousel, pagination, breadcrumb, qty stepper, rating stars, modal, tabs, step bar, product card - Pages: home floors, search (filters/sort/paging), goods detail (SKU picker, store rail, review tabs), cart -> checkout -> pay -> success, auth pages, user center (dashboard/orders/addresses/favorites/coupons/ invoices), stores, seckill, collective, integral - i18n split into per-domain locale modules (en+zh) - OpenSpec change mall-pc-storefront-replica archived; all specs green
46 lines
993 B
Vue
46 lines
993 B
Vue
<script setup lang="ts">
|
|
defineProps<{ tabs: { key: string; label: string }[]; modelValue: string }>();
|
|
const emit = defineEmits<{ "update:modelValue": [key: string] }>();
|
|
</script>
|
|
|
|
<template>
|
|
<div class="tabs">
|
|
<div class="tab-head">
|
|
<button
|
|
v-for="tab in tabs"
|
|
:key="tab.key"
|
|
type="button"
|
|
:class="{ on: tab.key === modelValue }"
|
|
@click="emit('update:modelValue', tab.key)"
|
|
>{{ tab.label }}</button>
|
|
</div>
|
|
<div class="tab-body">
|
|
<slot :active="modelValue" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.tab-head {
|
|
display: flex;
|
|
border-bottom: 1px solid var(--mall-line);
|
|
}
|
|
.tab-head button {
|
|
border: 0;
|
|
background: none;
|
|
padding: 12px 24px;
|
|
font-size: 14px;
|
|
cursor: pointer;
|
|
color: var(--mall-muted);
|
|
border-bottom: 2px solid transparent;
|
|
}
|
|
.tab-head button.on {
|
|
color: var(--mall-red);
|
|
border-bottom-color: var(--mall-red);
|
|
font-weight: 600;
|
|
}
|
|
.tab-body {
|
|
padding: 20px 0;
|
|
}
|
|
</style>
|