Files
vmall/apps/mall/components/PriceText.vue
T
Chengdong Zhang 0d0e10b97b feat(ui): adopt Tailwind v4 design system and archive change
- Add tailwindcss v4 + @tailwindcss/vite to mall, shop-admin, admin
- Add @vmall/shared/theme.css tokens with html[data-accent] presets
- Add @vmall/ui kit (VBtn/VBadge/VField/VInput/VCard/VPanel/VTable/VPage,
  VAccentSwatch, useAccent) as a Nuxt module
- Convert all three apps to kit + utilities; delete ui.css/mall.css and
  every <style scoped>; consoles get accent presets, mall locked to red
- Fix VCard boolean prop default (padding) and PDP/store stale
  useAsyncData keys on param navigation
- Archive adopt-tailwind-design-system; new frontend-ui capability spec
2026-09-22 18:22:50 +08:00

33 lines
758 B
Vue

<script setup lang="ts">
const props = defineProps<{
amountMinor: number;
currency: string;
}>();
const { formatPrice, currency } = usePrice();
const display = ref("");
const failed = ref(false);
async function refresh(): Promise<void> {
if (import.meta.server) return;
failed.value = false;
try {
display.value = await formatPrice(props.amountMinor, props.currency, currency.value);
} catch {
failed.value = true;
display.value = "";
}
}
watch(
[() => props.amountMinor, () => props.currency, currency],
() => void refresh(),
{ immediate: true },
);
</script>
<template>
<span v-if="failed" class="text-muted">{{ $t("mall.notAvailable") }}</span>
<span v-else>{{ display || $t("common.loading") }}</span>
</template>