This commit is contained in:
2022-12-09 16:41:41 +08:00
parent c1cce5a7c2
commit ff7aa8774f
2003 changed files with 156639 additions and 140 deletions

View File

@@ -0,0 +1,450 @@
const menus = [
{
id: 1,
title: "通用",
children: [
{
id: 20,
title: "颜色",
subTitle: "color",
path: "/zh-CN/components/color",
},
{
id: 6,
title: "按钮",
flag: "update",
subTitle: "button",
path: "/zh-CN/components/button",
},
{
id: 7,
title: "图标",
subTitle: "iconfont",
path: "/zh-CN/components/icon",
},
{
id: 10,
title: "动画",
subTitle: "animation",
path: "/zh-CN/components/animation",
},
{
id: 101,
title: "过渡",
subTitle: "transition",
path: "/zh-CN/components/transition",
},
{
id: 102,
title: "全屏",
subTitle: "fullscreen",
path: "/zh-CN/components/fullscreen",
},
{
id: 103,
title: "波纹",
subTitle: "ripple",
path: "/zh-CN/components/ripple",
},
],
},
{
id: 1,
title: "布局",
children: [
{
id: 4,
title: "布局",
subTitle: "layout",
path: "/zh-CN/components/layout",
},
{
id: 5,
title: "容器",
subTitle: "container",
path: "/zh-CN/components/container",
},
{
id: 11,
title: "栅格",
subTitle: "grid",
path: "/zh-CN/components/grid",
},
{
id: 8,
title: "面板",
subTitle: "panel",
path: "/zh-CN/components/panel",
},
{
id: 9,
title: "卡片",
subTitle: "card",
path: "/zh-CN/components/card",
},
{
id: 10,
title: "骨架",
subTitle: "skeleton",
path: "/zh-CN/components/skeleton",
},
{
id: 12,
title: "间距",
subTitle: "space",
path: "/zh-CN/components/space",
},
],
},
{
id: 1,
title: "导航",
children: [
{
id: 16,
title: "菜单",
subTitle: "menu",
path: "/zh-CN/components/menu",
},
{
id: 17,
title: "面包屑",
subTitle: "breadcrumb",
path: "/zh-CN/components/breadcrumb",
},
{
id: 17,
title: "页头",
subTitle: "pageHeader",
path: "/zh-CN/components/pageheader",
},
{
id: 28,
title: "选项卡",
subTitle: "tab",
path: "/zh-CN/components/tab",
},
{
id: 27,
title: "下拉菜单",
subTitle: "dropdown",
path: "/zh-CN/components/dropdown",
},
{
id: 42,
title: "返回顶部",
subTitle: "backtop",
path: "/zh-CN/components/backtop",
},
],
},
{
id: 1,
title: "表单",
children: [
{
id: 36,
title: "开关",
flag: "update",
subTitle: "switch",
path: "/zh-CN/components/switch",
},
{
id: 32,
title: "复选框",
subTitle: "checkbox",
path: "/zh-CN/components/checkbox",
},
{
id: 33,
title: "单选框",
subTitle: "radio",
path: "/zh-CN/components/radio",
},
{
id: 34,
title: "输入框",
subTitle: "input",
path: "/zh-CN/components/input",
},
{
id: 341,
title: "数字输入框",
subTitle: "inputNumber",
path: "/zh-CN/components/inputNumber",
},
{
id: 35,
title: "文本域",
subTitle: "textarea",
path: "/zh-CN/components/textarea",
},
{
id: 39,
title: "下拉选择",
subTitle: "select",
path: "/zh-CN/components/select",
},
{
id: 39,
title: "标签输入框",
subTitle: "tagInput",
path: "/zh-CN/components/tagInput",
},
{
id: 40,
title: "颜色选择器",
subTitle: "colorPicker",
path: "/zh-CN/components/colorPicker",
},
{
id: 40,
title: "日期选择器",
subTitle: "datePicker",
path: "/zh-CN/components/datePicker",
},
{
id: 40,
title: "级联选择器",
subTitle: "cascader",
path: "/zh-CN/components/cascader",
},
{
id: 40,
title: "文件上传",
subTitle: "upload",
path: "/zh-CN/components/upload",
},
{
id: 29,
title: "图标选择器",
subTitle: "iconPicker",
path: "/zh-CN/components/iconPicker",
},
{
id: 26,
title: "评分",
subTitle: "rate",
path: "/zh-CN/components/rate",
},
{
id: 37,
title: "滑块",
subTitle: "slider",
path: "/zh-CN/components/slider",
},
{
id: 12,
title: "表单",
subTitle: "form",
path: "/zh-CN/components/form",
},
],
},
{
id: 1,
title: "展示",
children: [
{
id: 18,
title: "进度",
subTitle: "progress",
path: "/zh-CN/components/progress",
},
{
id: 19,
title: "时间线",
subTitle: "timeline",
path: "/zh-CN/components/timeline",
},
{
id: 21,
title: "折叠面板",
subTitle: "collapse",
path: "/zh-CN/components/collapse",
},
{
id: 22,
title: "表格",
subTitle: "table",
path: "/zh-CN/components/table",
},
{
id: 23,
title: "头像",
subTitle: "avatar",
path: "/zh-CN/components/avatar",
},
{
id: 25,
title: "空",
subTitle: "empty",
path: "/zh-CN/components/empty",
},
{
id: 29,
title: "分页",
subTitle: "page",
path: "/zh-CN/components/page",
},
{
id: 30,
title: "树形组件",
subTitle: "tree",
path: "/zh-CN/components/tree",
},
{
id: 31,
title: "穿梭框",
subTitle: "transfer",
path: "/zh-CN/components/transfer",
},
{
id: 38,
title: "轮播",
subTitle: "carousel",
path: "/zh-CN/components/carousel",
},
{
id: 43,
title: "数字滚动",
subTitle: "countUp",
path: "/zh-CN/components/countup",
},
],
},
{
id: 1,
title: "辅助",
children: [
{
id: 13,
title: "徽章",
subTitle: "badge",
path: "/zh-CN/components/badge",
},
{
id: 14,
title: "引用",
subTitle: "quote",
path: "/zh-CN/components/quote",
},
{
id: 15,
title: "分割",
subTitle: "line",
path: "/zh-CN/components/line",
},
{
id: 24,
title: "字段",
subTitle: "field",
path: "/zh-CN/components/field",
},
{
id: 25,
title: "文字提示",
subTitle: "tooltip",
path: "/zh-CN/components/tooltip",
},
{
id: 99,
title: "分步",
subTitle: "step",
path: "/zh-CN/components/step",
},
{
id: 100,
title: "分割面板",
subTitle: "splitPanel",
path: "/zh-CN/components/splitPanel",
},
{
id: 100,
title: "异常",
subTitle: "exception",
path: "/zh-CN/components/exception",
},
{
id: 100,
title: "结果",
subTitle: "result",
path: "/zh-CN/components/result",
},
{
id: 100,
title: "虚拟滚动",
subTitle: "scroll",
path: "/zh-CN/components/scroll",
},
{
id: 114,
title: "通告栏",
subTitle: "noticeBar",
path: "/zh-CN/components/noticeBar",
},
{
id: 100,
title: "锚点",
subTitle: "affix",
path: "/zh-CN/components/affix",
},
{
id: 110,
title: "标签",
subTitle: "tag",
path: "/zh-CN/components/tag",
},
],
},
{
id: 1,
title: "反馈",
children: [
{
id: 90,
title: "模态框",
subTitle: "modal",
path: "/zh-CN/components/modal",
},
{
id: 91,
title: "加载",
subTitle: "load",
path: "/zh-CN/components/load",
},
{
id: 92,
title: "对话框",
subTitle: "confirm",
path: "/zh-CN/components/confirm",
},
{
id: 93,
title: "消息",
subTitle: "msg",
path: "/zh-CN/components/msg",
},
{
id: 94,
title: "抽屉",
subTitle: "drawer",
path: "/zh-CN/components/drawer",
},
{
id: 94,
title: "通知",
subTitle: "notifiy",
path: "/zh-CN/components/notifiy",
},
{
id: 94,
title: "相册",
subTitle: "photo",
path: "/zh-CN/components/photo",
},
],
},
];
export default menus;

View File

@@ -0,0 +1,10 @@
function indentHandle(obj) {
const { indent, level, basePadding = 0, isTree } = obj;
const least = level - 1;
if (isTree && indent && least > 0) {
const px = typeof indent === "boolean" ? `${basePadding + 10 * least}px` : indent.replace(/\d+/g, (s) => (basePadding + least * +s).toString());
return `padding-left: ${px}`;
}
return "";
}
export { indentHandle as i };

View File

@@ -0,0 +1,20 @@
<script lang="ts">
export default {
name: "TemplateIcon",
};
</script>
<script setup lang="ts">
import LayIcon from "../component/icon/index";
const props = defineProps<{
color?: string;
size?: string;
}>();
</script>
<template>
<lay-icon
:color="props.color"
:size="props.size"
type="layui-icon-template"
/>
</template>

View File

@@ -0,0 +1,49 @@
import { ValidateMessages } from "async-validator";
// 中文翻译 --> 根据 async-validator 中 ValidateMessages 进行翻译
export default {
default: "%s验证失败",
required: "%s不能为空",
enum: "%s不在枚举%s里面",
whitespace: "%s不能为空",
date: {
format: "%s日期%s不是一个有效格式的日期%s",
parse: "%s无法解析为日期,%s是无效的",
invalid: "%s日期%s是无效的",
},
types: {
number: "%s不是一个有效的数字",
boolean: "%s不是一个有效的布尔类型",
method: "%s不是一个有效的方法",
regexp: "%s不是一个有效的正则表达式",
integer: "%s不是一个有效的整型数字",
float: "%s不是一个有效的浮点小数",
array: "%s不是一个有效的数组",
object: "%s不是一个有效的对象",
enum: "%s不是一个有效的枚举",
date: "%s不是一个有效的日期",
url: "%s不是一个有效的url",
hex: "%s不是一个有效的十六进制",
email: "%s不是一个有效的邮箱",
},
string: {
len: "%s必须是长度为%s个字符",
min: "%s最小长度为%s个字符",
max: "%s最长%s个字符",
range: "%s字符长度需要在%s和%s之间",
},
number: {
len: "%s长度必须为%s",
min: "%s必须小于%s",
max: "%s必须大于%s",
range: "%s需要在%s和%s之间",
},
array: {
len: "%s长度必须为%s",
min: "%s长度必须小于%s",
max: "%s长度必须大于%s",
range: "%s长度需要在%s和%s之间",
},
pattern: {
mismatch: "%s值%s不能匹配%s",
},
} as ValidateMessages;

View File

@@ -0,0 +1,37 @@
import{o as t,c as s,a as e,b as l}from"./index.7556f252.js";const a={class:"markdown-body"},o=e("fieldset",{class:"layui-elem-field layui-field-title"},[e("legend",null,"\u5B89\u88C5")],-1),i=e("p",null,"\u901A\u8FC7 npm \u5DE5\u5177\u5B89\u88C5 :",-1),c=e("div",{class:"language-"},[e("pre",null,[e("code",{"v-pre":""},`npm install @layui/layer-vue
`)])],-1),p=e("p",null,"\u5728 main.ts \u5B8C\u6210 layer-vue \u7684\u6CE8\u518C, \u5E76\u5BFC\u5165 css \u6587\u4EF6 :",-1),r=e("div",{class:"language-"},[e("pre",null,[e("code",{"v-pre":""},`import App from './App';
import { createApp } from 'vue';
import layer from '@layui/layer-vue';
import '@layui/layer-vue/lib/index.css';
const app = createApp(App);
app.use(layer).mount('#app');
`)])],-1),u=e("fieldset",{class:"layui-elem-field layui-field-title"},[e("legend",null,"\u573A\u666F")],-1),d=e("p",null,"\u56E0 layer-vue \u53EF\u4EE5\u72EC\u7ACB\u4F7F\u7528\uFF0C\u4E5F\u53EF\u4EE5\u5728 layui-vue \u4E2D\u4F7F\u7528\u3002\u6240\u4EE5\u8BF7\u6309\u7167\u4F60\u7684\u5B9E\u9645\u9700\u6C42\u6765\u9009\u62E9\u3002",-1),_=e("p",null,"\u5982\u679C\u4F60\u60F3\u72EC\u7ACB\u4F7F\u7528 layer-vue, \u4F60\u9700\u8981\u901A\u8FC7 npm \u5B89\u88C5\u3002\u5982\u679C\u4F60\u4F7F\u7528\u7684\u662F layui-vue, \u90A3\u4E48\u4F60\u65E0\u9700\u5B89\u88C5 layer-vue, \u5DF2\u5185\u7F6E\u3002",-1),y=e("fieldset",{class:"layui-elem-field layui-field-title"},[e("legend",null,"\u5165\u95E8")],-1),m=e("p",null,[l("\u6211\u4EEC\u63D0\u4F9B "),e("code",null,"layer"),l(" \u51FD\u6570\u6765\u521B\u5EFA\u5F39\u51FA\u5C42 :")],-1),v=e("div",{class:"language-"},[e("pre",null,[e("code",{"v-pre":""},`<template>
<button type="button" @click="open">\u6253\u5F00</button>
</template>
<script setup>
import { layer } from "@layui/layer-vue";
const open = function () {
layer.open({title:"\u6807\u9898", content: "\u5185\u5BB9"});
};
<\/script>
`)])],-1),f=e("p",null,[l("\u4F46\u5728\u8F83\u4E3A\u590D\u6742\u7684\u5E94\u7528\u573A\u666F\u4E2D, "),e("code",null,"lay-layer"),l(" \u662F\u4E00\u4E2A\u66F4\u597D\u7684\u9009\u62E9 :")],-1),h=e("div",{class:"language-"},[e("pre",null,[e("code",{"v-pre":""},`<template>
<button @click="changeVisible">\u663E\u793A/\u9690\u85CF</button>
<lay-layer v-model="visible">
content
</lay-layer>
</template>
<script setup>
import { ref } from "vue";
const visible = ref(false);
const changeVisible = () => {
visible.value = !visible.value;
}
<\/script>
`)])],-1),b=[o,i,c,p,r,u,d,_,y,m,v,f,h],V={},B={__name:"index",setup(g,{expose:n}){return n({frontmatter:{}}),(k,x)=>(t(),s("div",a,b))}};export{B as default,V as frontmatter};