From b45df1c1c1740160d5d0c538bdb0c8008db125ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E4=BB=AA=E5=BC=8F?= <854085467@qq.com>
Date: Fri, 15 Oct 2021 17:50:50 +0800
Subject: [PATCH] =?UTF-8?q?feat(slider):=20=E5=88=9D=E6=AD=A5=E9=9B=86?=
=?UTF-8?q?=E6=88=90=20slider=20=E6=BB=91=E5=9D=97=E7=BB=84=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/docs/zh-CN/components/layout.md | 5 ++-
docs/docs/zh-CN/components/slider.md | 42 +++++++++++++++++++
docs/docs/zh-CN/guide/changelog.md | 8 +++-
.../zh-CN/guide/{install.md => getStarted.md} | 3 ++
.../zh-CN/guide/{home.md => introduce.md} | 0
docs/src/layouts/Layout.vue | 26 ++++++++----
docs/src/plugin/create-container.ts | 2 +-
docs/src/router/zh-CN.ts | 14 ++++---
docs/src/styles/vars.css | 23 ----------
package.json | 2 +-
src/index.ts | 5 ++-
.../module/colorPicker/index.ts | 0
src/module/colorPicker/index.vue | 0
src/module/slider/index.ts | 9 ++++
src/module/slider/index.vue | 38 +++++++++++++++++
15 files changed, 135 insertions(+), 42 deletions(-)
create mode 100644 docs/docs/zh-CN/components/slider.md
rename docs/docs/zh-CN/guide/{install.md => getStarted.md} (95%)
rename docs/docs/zh-CN/guide/{home.md => introduce.md} (100%)
rename docs/docs/zh-CN/guide/index.md => src/module/colorPicker/index.ts (100%)
create mode 100644 src/module/colorPicker/index.vue
create mode 100644 src/module/slider/index.ts
create mode 100644 src/module/slider/index.vue
diff --git a/docs/docs/zh-CN/components/layout.md b/docs/docs/zh-CN/components/layout.md
index 45edd55a..0fd83dd4 100644
--- a/docs/docs/zh-CN/components/layout.md
+++ b/docs/docs/zh-CN/components/layout.md
@@ -1,3 +1,6 @@
+::: field 后台布局
+:::
+
@@ -5,7 +8,7 @@
-layui 之所以赢得如此多人的青睐,更多是在于它「前后界面兼备」的能力。既可编织出绚丽的前台页面,又可满足繁杂的管理系统界面需求。layui 致力于让每一位开发者都能轻松搭建自己的管理界面。下面是演示代码 :
+
layui 之所以赢得如此多人的青睐,更多是在于它「前后界面兼备」的能力。既可编织出绚丽的前台页面,又可满足繁杂的管理系统界面需求。layui 致力于让每一位开发者都能轻松搭建自己的管理界面。下面是演示代码 :
diff --git a/docs/docs/zh-CN/components/slider.md b/docs/docs/zh-CN/components/slider.md
new file mode 100644
index 00000000..8f3e6c7a
--- /dev/null
+++ b/docs/docs/zh-CN/components/slider.md
@@ -0,0 +1,42 @@
+::: demo
+
+
+
+
+
+
+
+:::
+
+::: demo
+
+
+
+
+
+
+
+:::
\ No newline at end of file
diff --git a/docs/docs/zh-CN/guide/changelog.md b/docs/docs/zh-CN/guide/changelog.md
index 0c68187b..82b2cf23 100644
--- a/docs/docs/zh-CN/guide/changelog.md
+++ b/docs/docs/zh-CN/guide/changelog.md
@@ -1,7 +1,13 @@
-::: demo
+::: field 更新记录
+:::
+::: demo
+
+ [新增] menu 菜单 title 插槽,允许自定义菜单项。
+ [新增] menu 菜单 title 插槽,允许自定义菜单项。
+
[新增] menu 菜单 title 插槽,允许自定义菜单项。
[新增] table 表格 toolbar 插槽, 用于自定义工具栏。
diff --git a/docs/docs/zh-CN/guide/install.md b/docs/docs/zh-CN/guide/getStarted.md
similarity index 95%
rename from docs/docs/zh-CN/guide/install.md
rename to docs/docs/zh-CN/guide/getStarted.md
index a3623249..3fc20f69 100644
--- a/docs/docs/zh-CN/guide/install.md
+++ b/docs/docs/zh-CN/guide/getStarted.md
@@ -1,3 +1,6 @@
+::: field 快速上手
+:::
+
使用 npm 下载
diff --git a/docs/docs/zh-CN/guide/home.md b/docs/docs/zh-CN/guide/introduce.md
similarity index 100%
rename from docs/docs/zh-CN/guide/home.md
rename to docs/docs/zh-CN/guide/introduce.md
diff --git a/docs/src/layouts/Layout.vue b/docs/src/layouts/Layout.vue
index c8b6ec82..56aebe4a 100644
--- a/docs/src/layouts/Layout.vue
+++ b/docs/src/layouts/Layout.vue
@@ -31,7 +31,7 @@
- 0.1.3
+ 0.1.4
@@ -74,12 +74,15 @@ export default {
setup() {
const route = useRoute()
const router = useRouter()
- const currentPath = ref('hahaha')
+ const currentPath = ref('/zh-CN/guide')
watch(
() => route.path,
- (newValue, oldValue) => {
- currentPath.value = route.path
+ (val) => {
+ currentPath.value = val
+ },{
+ immediate: true,
+ deep: true
}
)
@@ -87,19 +90,19 @@ export default {
{
id: 1,
title: '介绍',
- subTitle: 'Getting Started',
- path: '/zh-CN/guide',
+ subTitle: 'introduce',
+ path: '/zh-CN/guide/introduce',
},
{
id: 2,
title: '安装',
- subTitle: 'install',
- path: '/zh-CN/guide/install',
+ subTitle: 'get started',
+ path: '/zh-CN/guide/getStarted',
},
{
id: 3,
title: '更新',
- subTitle: 'changelog',
+ subTitle: 'change log',
path: '/zh-CN/guide/changelog',
},
{
@@ -301,6 +304,11 @@ export default {
title: '开关',
subTitle: 'switch',
path: '/zh-CN/components/switch',
+ },{
+ id: 37,
+ title: '滑块',
+ subTitle: 'slider',
+ path: '/zh-CN/components/slider',
}
]
diff --git a/docs/src/plugin/create-container.ts b/docs/src/plugin/create-container.ts
index 7b59c40e..a1f0220f 100644
--- a/docs/src/plugin/create-container.ts
+++ b/docs/src/plugin/create-container.ts
@@ -23,7 +23,7 @@ export default function createContainer(
if (token.nesting === 1) {
return ``
+ }" style="margin-top:10px;margin-bottom: 10px;">`
} else {
return '\n'
}
diff --git a/docs/src/router/zh-CN.ts b/docs/src/router/zh-CN.ts
index d0e7465f..f639d4cd 100644
--- a/docs/src/router/zh-CN.ts
+++ b/docs/src/router/zh-CN.ts
@@ -3,18 +3,18 @@ import BaseLayout from '../layouts/Layout.vue'
const zhCN = [
{
path: '/',
- redirect: '/zh-CN/guide/',
+ redirect: '/zh-CN/guide/introduce',
component: BaseLayout,
meta: { title: '指南', icon: 'el-icon-position' },
children: [
{
- path: '/zh-CN/guide/',
- component: () => import('../../docs/zh-CN/guide/home.md'),
+ path: '/zh-CN/guide/introduce',
+ component: () => import('../../docs/zh-CN/guide/introduce.md'),
meta: { title: '介绍' },
},
{
- path: '/zh-CN/guide/install',
- component: () => import('../../docs/zh-CN/guide/install.md'),
+ path: '/zh-CN/guide/getStarted',
+ component: () => import('../../docs/zh-CN/guide/getStarted.md'),
meta: { title: '安装' },
},
{
@@ -194,6 +194,10 @@ const zhCN = [
path: '/zh-CN/components/switch',
component: () => import('../../docs/zh-CN/components/switch.md'),
meta: { title: '开关' },
+ },{
+ path: '/zh-CN/components/slider',
+ component: () => import('../../docs/zh-CN/components/slider.md'),
+ meta: { title: '滑块' },
},
],
},
diff --git a/docs/src/styles/vars.css b/docs/src/styles/vars.css
index dd69d991..b590e53a 100644
--- a/docs/src/styles/vars.css
+++ b/docs/src/styles/vars.css
@@ -1,32 +1,9 @@
:root {
--c-white: #ffffff;
--c-black: #000000;
-
- --c-divider-light: rgba(60, 60, 67, 0.12);
- --c-divider-dark: rgba(84, 84, 88, 0.48);
-
- --c-text-light-1: #2c3e50;
- --c-text-light-2: #476582;
- --c-text-light-3: #90a4b7;
-
- --c-brand-light: #4abf8a;
-
- --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
- --shadow-2: 0 3px 12px rgba(0, 0, 0, 0.07), 0 1px 4px rgba(0, 0, 0, 0.07);
- --shadow-3: 0 12px 32px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.08);
- --shadow-4: 0 14px 44px rgba(0, 0, 0, 0.12), 0 3px 9px rgba(0, 0, 0, 0.12);
- --shadow-5: 0 18px 56px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.16);
}
:root {
- --c-divider: var(--c-divider-light);
-
- --c-text: var(--c-text-light-1);
- --c-text-light: var(--c-text-light-2);
- --c-text-lighter: var(--c-text-light-3);
-
- --c-bg: var(--c-white);
-
--code-line-height: 24px;
--code-font-family: var(--font-family-mono);
--code-font-size: 14px;
diff --git a/package.json b/package.json
index 82dc7a8f..9b1ae235 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@layui/layui-vue",
- "version": "0.1.3",
+ "version": "0.1.4",
"description": "a component library for Vue 3 base on layui-vue",
"main": "lib/layui-vue.umd.js",
"module": "lib/layui-vue.es.js",
diff --git a/src/index.ts b/src/index.ts
index 3faf4b15..0f323567 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -54,6 +54,7 @@ import LayTable from './module/table/index'
import LayPage from './module/page/index'
import LayTransfer from './module/transfer/index'
import LayCheckboxGroup from './module/checkboxGroup/index'
+import LaySlider from './module/slider/index'
const components: Record = {
LayRadio,
@@ -107,7 +108,8 @@ const components: Record = {
LayTable,
LayPage,
LayTransfer,
- LayCheckboxGroup
+ LayCheckboxGroup,
+ LaySlider
}
const install = (app: App, options?: InstallOptions): void => {
@@ -175,6 +177,7 @@ export {
LayPage,
LayTransfer,
LayCheckboxGroup,
+ LaySlider,
install,
}
diff --git a/docs/docs/zh-CN/guide/index.md b/src/module/colorPicker/index.ts
similarity index 100%
rename from docs/docs/zh-CN/guide/index.md
rename to src/module/colorPicker/index.ts
diff --git a/src/module/colorPicker/index.vue b/src/module/colorPicker/index.vue
new file mode 100644
index 00000000..e69de29b
diff --git a/src/module/slider/index.ts b/src/module/slider/index.ts
new file mode 100644
index 00000000..b2db3b4b
--- /dev/null
+++ b/src/module/slider/index.ts
@@ -0,0 +1,9 @@
+import type { App } from 'vue'
+import Component from './index.vue'
+import type { IDefineComponent } from '../type/index'
+
+Component.install = (app: App) => {
+ app.component(Component.name || 'LaySlider', Component)
+}
+
+export default Component as IDefineComponent
diff --git a/src/module/slider/index.vue b/src/module/slider/index.vue
new file mode 100644
index 00000000..5eeec521
--- /dev/null
+++ b/src/module/slider/index.vue
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
\ No newline at end of file