document internationalization
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<lay-config-provider
|
||||
:locale="locale"
|
||||
:theme="theme"
|
||||
:locale="locale"
|
||||
:locales="locales"
|
||||
:themeVariable="themeVariable">
|
||||
<lay-layout class="layui-layout-document">
|
||||
@@ -79,23 +79,16 @@ export default {
|
||||
setup() {
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const currentPath = ref("/zh-CN/guide");
|
||||
// 当前语言
|
||||
const locale = ref('zh_CN');
|
||||
// 扩展语言包
|
||||
const currentPath = ref("/zh-CN/guide");
|
||||
const locales = [
|
||||
{name:'zh_CN',locale: zh_CN, merge: true},
|
||||
{name:'en_US',locale: en_US, merge: true}
|
||||
]
|
||||
// 当前主题
|
||||
{name:'en_US',locale: en_US, merge: true},
|
||||
];
|
||||
const theme = "light";
|
||||
// 主题变量
|
||||
const themeVariable = {
|
||||
|
||||
}
|
||||
const themeVariable = {}
|
||||
|
||||
const menus = [];
|
||||
|
||||
@@ -105,11 +98,9 @@ export default {
|
||||
});
|
||||
});
|
||||
|
||||
watch(
|
||||
() => route.path, (val) => {
|
||||
watch(() => route.path, (val) => {
|
||||
currentPath.value = val;
|
||||
},{immediate: true, deep: true}
|
||||
);
|
||||
},{immediate: true, deep: true});
|
||||
|
||||
const handleClick = function (menu) {
|
||||
router.push(menu.path);
|
||||
@@ -125,15 +116,17 @@ export default {
|
||||
theme,
|
||||
locale,
|
||||
locales,
|
||||
themeVariable,
|
||||
currentPath,
|
||||
handleClick,
|
||||
changeLocale,
|
||||
themeVariable
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
.layui-layout-document > .layui-header {
|
||||
z-index: 9999;
|
||||
width: 100%;
|
||||
@@ -164,6 +157,7 @@ export default {
|
||||
left: 15px;
|
||||
top: 16px;
|
||||
}
|
||||
|
||||
.layui-header > .layui-nav {
|
||||
background-color: transparent;
|
||||
}
|
||||
@@ -183,9 +177,11 @@ export default {
|
||||
.layui-menu-docs {
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.layui-menu-docs .layui-menu-body-title .layui-font-gray {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.layui-side hr {
|
||||
margin: 8px;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import highlight from "./highlight";
|
||||
import snippet from "./snippet";
|
||||
import demo from "./demo";
|
||||
import createTitle from "./create-title";
|
||||
import createBlock from "./create-block";
|
||||
import createQuote from "./create-quote";
|
||||
import createDescribe from "./create-describe";
|
||||
import createTable from "./create-table";
|
||||
import createComment from "./create-comment";
|
||||
@@ -29,7 +29,7 @@ const plugins = [
|
||||
.use(preWrapper)
|
||||
.use(container, "demo", demo)
|
||||
.use(...createTable("table", ""))
|
||||
.use(...createBlock("block", ""))
|
||||
.use(...createQuote("quote", ""))
|
||||
.use(...createTitle("title", ""))
|
||||
.use(...createDescribe("describe", ""))
|
||||
.use(...createComment("comment", ""))
|
||||
|
||||
@@ -18,9 +18,9 @@ export default function createContainer(
|
||||
const token = tokens[idx]
|
||||
const info = token.info.trim().slice(klass.length).trim()
|
||||
if (token.nesting === 1) {
|
||||
return `<lay-block style="margin-left:0px;margin-right:0px;margin-top:20px;margin-bottom:40px;">${info}`
|
||||
return `<lay-quote style="margin-left:0px;margin-right:0px;margin-top:20px;margin-bottom:40px;">${info}`
|
||||
} else {
|
||||
return '</lay-block>\n'
|
||||
return '</lay-quote>\n'
|
||||
}
|
||||
},
|
||||
},
|
||||
@@ -144,8 +144,8 @@ const zhCN = [
|
||||
meta: { title: "徽章" },
|
||||
},
|
||||
{
|
||||
path: "/zh-CN/components/block",
|
||||
component: () => import("../../docs/zh-CN/components/block.md"),
|
||||
path: "/zh-CN/components/quote",
|
||||
component: () => import("../../docs/zh-CN/components/quote.md"),
|
||||
meta: { title: "辅助" },
|
||||
},
|
||||
{
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
style="margin-top: 60px; height: 100%; width: 80%"
|
||||
class="layui-container"
|
||||
>
|
||||
<blockquote class="layui-elem-quote layui-text" style="margin: 30px 0">
|
||||
<blockquote class="layui-quote layui-text" style="margin: 30px 0">
|
||||
尽管 layui-vue 中包含了这些组件,但因为它们受众群体广泛或应用广泛,特从 layui-vue
|
||||
中抽取出来个副本,可独立引用。我们也会对它们进行同步维护。
|
||||
</blockquote>
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
<fieldset class="layui-field layui-field-title">
|
||||
<legend style="margin-bottom: 20px; text-align: center">独立组件</legend>
|
||||
<div class="layui-field-box">
|
||||
<ul class="layui-row layui-col-space6">
|
||||
@@ -28,7 +28,7 @@
|
||||
</ul>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
<fieldset class="layui-field layui-field-title">
|
||||
<legend style="margin-bottom: 20px; text-align: center">后台模板</legend>
|
||||
<div class="layui-field-box">
|
||||
<ul class="layui-row layui-col-space6">
|
||||
@@ -42,7 +42,7 @@
|
||||
</ul>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
<fieldset class="layui-field layui-field-title">
|
||||
<legend style="margin-bottom: 20px; text-align: center">设计资源</legend>
|
||||
<div class="layui-field-box">
|
||||
<ul class="layui-row layui-col-space6">
|
||||
|
||||
@@ -269,9 +269,9 @@ const menus = [
|
||||
},
|
||||
{
|
||||
id: 14,
|
||||
title: "区块",
|
||||
subTitle: "block",
|
||||
path: "/zh-CN/components/block",
|
||||
title: "引用",
|
||||
subTitle: "quote",
|
||||
path: "/zh-CN/components/quote",
|
||||
},
|
||||
{
|
||||
id: 15,
|
||||
|
||||
Reference in New Issue
Block a user