From 15372347a39e19bd0c47174db78774847cdf18a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E5=84=80=E5=BC=8F?= <854085467@qq.com> Date: Sun, 2 Oct 2022 06:11:10 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(component):=20=E6=96=B0=E5=A2=9E=20tr?= =?UTF-8?q?eeSelect=20=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/component/treeSelect/index.vue | 70 ++++- package/component/src/index.ts | 3 + .../document/zh-CN/components/treeSelect.md | 239 ++++++++++++++++++ .../document-component/src/router/zh-CN.ts | 5 + .../src/view/utils/menus.ts | 6 + 5 files changed, 320 insertions(+), 3 deletions(-) create mode 100644 package/document-component/src/document/zh-CN/components/treeSelect.md diff --git a/package/component/src/component/treeSelect/index.vue b/package/component/src/component/treeSelect/index.vue index 9fa815db..ce9d27c6 100644 --- a/package/component/src/component/treeSelect/index.vue +++ b/package/component/src/component/treeSelect/index.vue @@ -1,9 +1,73 @@ - + + + + + diff --git a/package/component/src/index.ts b/package/component/src/index.ts index 97b4475d..8e62a432 100644 --- a/package/component/src/index.ts +++ b/package/component/src/index.ts @@ -61,6 +61,7 @@ import LayDropdownSubMenu from "./component/dropdownSubMenu/index"; import LayTab from "./component/tab/index"; import LayTabItem from "./component/tabItem/index"; import LayTree from "./component/tree/index"; +import LayTreeSelect from "./component/treeSelect/index"; import LayTable from "./component/table/index"; import LayPage from "./component/page/index"; import LayTransfer from "./component/transfer/index"; @@ -180,6 +181,7 @@ const components: Record = { LaySpace, LayTag, LayTagInput, + LayTreeSelect }; const install = (app: App, options?: InstallOptions): void => { @@ -276,6 +278,7 @@ export { LaySpace, LayTag, LayTagInput, + LayTreeSelect, install, }; diff --git a/package/document-component/src/document/zh-CN/components/treeSelect.md b/package/document-component/src/document/zh-CN/components/treeSelect.md new file mode 100644 index 00000000..77af48eb --- /dev/null +++ b/package/document-component/src/document/zh-CN/components/treeSelect.md @@ -0,0 +1,239 @@ +::: anchor +::: + +::: title 基本介绍 +::: + +::: describe 树形组件一般用于展示具有层级关系的数据 +::: + +::: title 基础使用 +::: + +::: demo 使用 `lay-tree` 标签, 创建树形组件, @node-click 监听节点点击。 + + + + + +::: + +::: title Tree 属性 +::: + +::: table + +| Name | Description | Accepted Values | +| -------------------------------- | ---------------------------------------- | --------------- | +| data | 树型组件数据,类型 TreeData \| TreeData[] | null | +| showCheckbox | 是否显示复选框 | false | +| onlyIconControl | 是否仅允许节点左侧图标控制展开收缩 | false | +| showLine | 是否开启连接线 | true | +| checkedKeys(v-model:checkedKeys) | 开启 showCheckbox 后, 选中的节点 | [] | +| collapse-transition | 是否开启展示收起动画 | false | + +::: + +::: title Tree 数据 +::: + +::: table + +| Name | Description | Accepted Values | +|---------------------|-------------| --------------- | +| id | 唯一值 | - | +| title | 节点名称 | - | +| children | 子节点 | [] | +| disabled | 该节点是否禁用 | false | +| spread | 该节点是否展开 | false | + +::: + +::: title Tree 事件 +::: + +::: table + +| Name | Description | Accepted Params | +| ---------- | --------------- | --------------- | +| node-click | 节点 click 事件 | -- | + +::: + + + +::: contributor transition +::: + +::: previousNext transition +::: diff --git a/package/document-component/src/router/zh-CN.ts b/package/document-component/src/router/zh-CN.ts index bf7c2cfe..ad10c1f2 100644 --- a/package/document-component/src/router/zh-CN.ts +++ b/package/document-component/src/router/zh-CN.ts @@ -236,6 +236,11 @@ const zhCN = [ component: () => import("../document/zh-CN/components/tree.md"), meta: { title: "树形组件" }, }, + { + path: "/zh-CN/components/treeSelect", + component: () => import("../document/zh-CN/components/treeSelect.md"), + meta: { title: "下拉树组件" }, + }, { path: "/zh-CN/components/page", component: () => import("../document/zh-CN/components/page.md"), diff --git a/package/document-component/src/view/utils/menus.ts b/package/document-component/src/view/utils/menus.ts index 7954cf8d..ba431e85 100644 --- a/package/document-component/src/view/utils/menus.ts +++ b/package/document-component/src/view/utils/menus.ts @@ -185,6 +185,12 @@ const menus = [ subTitle: "select", path: "/zh-CN/components/select", }, + { + id: 39, + title: "下拉树", + subTitle: "select", + path: "/zh-CN/components/treeSelect", + }, { id: 39, title: "标签输入框",