📝: 更新 locale 扩展文档

This commit is contained in:
就眠儀式 2022-05-04 00:39:12 +08:00
parent 2e2e742b43
commit 20b35892b8
4 changed files with 42 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@layui/layui-vue",
"version": "1.0.6",
"version": "1.0.7-alpha.1",
"author": "就眠儀式",
"license": "MIT",
"description": "a component library for Vue 3 base on layui-vue",

View File

@ -19,7 +19,12 @@ export interface LayMenuProps {
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>(), {
selectedKey: "",

View File

@ -11,6 +11,16 @@
<template>
<lay-timeline>
<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>
<a name="1-0-6"></a>
<li>

View File

@ -10,4 +10,29 @@
<App />
</lay-config-provider>
</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>
```