📝: 更新 locale 扩展文档
This commit is contained in:
parent
2e2e742b43
commit
20b35892b8
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@layui/layui-vue",
|
"name": "@layui/layui-vue",
|
||||||
"version": "1.0.6",
|
"version": "1.0.7-alpha.1",
|
||||||
"author": "就眠儀式",
|
"author": "就眠儀式",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"description": "a component library for Vue 3 base on layui-vue",
|
"description": "a component library for Vue 3 base on layui-vue",
|
||||||
|
@ -19,7 +19,12 @@ export interface LayMenuProps {
|
|||||||
collapseTransition?: boolean | string;
|
collapseTransition?: boolean | string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const emit = defineEmits(["update:selectedKey", "update:openKeys","changeSelectedKey","changeOpenKeys"]);
|
const emit = defineEmits([
|
||||||
|
"update:selectedKey",
|
||||||
|
"update:openKeys",
|
||||||
|
"changeSelectedKey",
|
||||||
|
"changeOpenKeys",
|
||||||
|
]);
|
||||||
|
|
||||||
const props = withDefaults(defineProps<LayMenuProps>(), {
|
const props = withDefaults(defineProps<LayMenuProps>(), {
|
||||||
selectedKey: "",
|
selectedKey: "",
|
||||||
|
@ -11,6 +11,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<lay-timeline>
|
<lay-timeline>
|
||||||
<lay-timeline-item title="1.0.x">
|
<lay-timeline-item title="1.0.x">
|
||||||
|
<ul>
|
||||||
|
<a name="1-0-7"></a>
|
||||||
|
<li>
|
||||||
|
<h3>1.0.7 <span class="layui-badge-rim">2022-05-03</span></h3>
|
||||||
|
<ul>
|
||||||
|
<li>[新增] menu 组件 changeOpenKeys 事件。</li>
|
||||||
|
<li>[新增] menu 组件 changeSelectedKey 事件。</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
<ul>
|
<ul>
|
||||||
<a name="1-0-6"></a>
|
<a name="1-0-6"></a>
|
||||||
<li>
|
<li>
|
||||||
|
@ -10,4 +10,29 @@
|
|||||||
<App />
|
<App />
|
||||||
</lay-config-provider>
|
</lay-config-provider>
|
||||||
</template>
|
</template>
|
||||||
|
```
|
||||||
|
::: describe layui-vue 内部会维护一个 vue-i18n 实例, 你无需再去创建,直接使用 useI18n() 获取即可
|
||||||
|
:::
|
||||||
|
|
||||||
|
::: describe 你可以使用 locales 属性来扩展语言包, 用户自定义语言包优先级大于组件库内部维护的语言包, 即你可以扩展亦可以覆盖。
|
||||||
|
:::
|
||||||
|
|
||||||
|
|
||||||
|
```vue
|
||||||
|
<template>
|
||||||
|
<lay-config-provider locale="zh_CN" :locales="locales">
|
||||||
|
<App />
|
||||||
|
</lay-config-provider>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
const locales = [
|
||||||
|
'zh_CN': {
|
||||||
|
message: '你好, layui-vue'
|
||||||
|
},
|
||||||
|
'en_US': {
|
||||||
|
message: 'hello, layui-vue'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
</script>
|
||||||
```
|
```
|
Loading…
Reference in New Issue
Block a user