feat: 添加 primelocale 依赖并更新 PrimeVue 组件以支持多语言选择
This commit is contained in:
@ -29,6 +29,7 @@
|
||||
<select id="locale" v-model="$i18n.locale">
|
||||
<option v-for="locale in $i18n.availableLocales" :key="locale" :value="locale">{{ locale }}</option>
|
||||
</select>
|
||||
<p>$i18n.locale: {{ $i18n.locale }}</p>
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -1,9 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
import { usePrimeVue } from 'primevue/config';
|
||||
import zhCN from 'primelocale/zh-CN.json';
|
||||
|
||||
const primevue = usePrimeVue();
|
||||
primevue.config.locale = zhCN['zh-CN'];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="pppppppp">
|
||||
<InputText />
|
||||
|
||||
<Button>PButton</Button>
|
||||
|
||||
<Select
|
||||
:options="[
|
||||
{ name: 'New York', code: 'NY' },
|
||||
@ -13,8 +18,12 @@
|
||||
{ name: 'Paris', code: 'PRS' },
|
||||
]"
|
||||
optionLabel="name"
|
||||
placeholder="Select a City"
|
||||
placeholder="选择城市"
|
||||
class="min-w-[200px]"
|
||||
/>
|
||||
|
||||
<DatePicker dateFormat="dd/mm/yy" />
|
||||
|
||||
<Button>PButton</Button>
|
||||
</div>
|
||||
</template>
|
||||
|
Reference in New Issue
Block a user