From f5fb500b52052a65a9d53a999692f1ba5318db6e Mon Sep 17 00:00:00 2001 From: ChuChencheng Date: Tue, 30 Jul 2024 05:10:24 +0800 Subject: [PATCH] feat: add dashDensity in showLine --- examples/Feature.vue | 8 +- package.json | 3 +- pnpm-lock.yaml | 7 -- site/.vitepress/code/ShowLine.vue | 8 ++ site/.vitepress/components/PlaygroundLink.vue | 2 +- site/.vitepress/config.mts | 9 +++ site/api/vtree.md | 74 +++++++++---------- site/en/api/vtree.md | 74 +++++++++---------- src/components/TreeNode.vue | 19 +++-- src/types/index.ts | 8 ++ 10 files changed, 121 insertions(+), 91 deletions(-) diff --git a/examples/Feature.vue b/examples/Feature.vue index d6fa112..6c48fec 100644 --- a/examples/Feature.vue +++ b/examples/Feature.vue @@ -147,7 +147,7 @@
@@ -169,6 +169,9 @@ {{ showLineType }}

当前连接线类型:{{showLineType}}

+

+ 虚线密度: {{ dashDensity }} +

showLine.polyline: @@ -437,6 +440,8 @@ export default defineComponent({ showLineType.value = type } + const dashDensity = ref(3) + const showLinePolyline = ref(false) const onShowLinePolylineBtnClick = (polyline: boolean) => { showLinePolyline.value = polyline @@ -485,6 +490,7 @@ export default defineComponent({ onShowLineTypeBtnClick, showLinePolyline, onShowLinePolylineBtnClick, + dashDensity, // 自定义节点 nodeSlotDescText, diff --git a/package.json b/package.json index 1e0297e..8733626 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@wsfe/vue-tree", - "version": "4.0.1", + "version": "4.1.0", "types": "./types", "description": "A vue tree component using virtual list.", "main": "./dist/vue-tree.umd.js", @@ -67,7 +67,6 @@ "@vue/repl": "^4.3.0", "@vue/test-utils": "^2.4.6", "@vue/vue3-jest": "^29.2.6", - "@wsfe/vue-tree": "^4.0.1", "autoprefixer": "^10.4.19", "happy-dom": "^14.12.0", "less": "^4.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 776b06c..30fc4a4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,9 +29,6 @@ devDependencies: '@vue/vue3-jest': specifier: ^29.2.6 version: 29.2.6(@babel/core@7.24.7)(babel-jest@29.7.0)(jest@29.7.0)(typescript@5.4.5)(vue@3.4.30) - '@wsfe/vue-tree': - specifier: ^4.0.1 - version: 4.0.1 autoprefixer: specifier: ^10.4.19 version: 10.4.19(postcss@8.4.38) @@ -2862,10 +2859,6 @@ packages: - vue dev: true - /@wsfe/vue-tree@4.0.1: - resolution: {integrity: sha512-B3a1bddMfvv2Nzjsw12EOID3ccvvPDiT1GSLY/LFP/S36EvvmMbR5giIj6yhigSpTYNF4j6ORiowMxpwM1Rt6w==} - dev: true - /abbrev@2.0.0: resolution: {integrity: sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} diff --git a/site/.vitepress/code/ShowLine.vue b/site/.vitepress/code/ShowLine.vue index d2af7d0..606c192 100644 --- a/site/.vitepress/code/ShowLine.vue +++ b/site/.vitepress/code/ShowLine.vue @@ -19,6 +19,12 @@
+ +
+ showLine.dashDensity: + + {{ dashDensity }} +
@@ -29,11 +35,13 @@ import VTree from '@wsfe/vue-tree' const type = ref('solid') const polyline = ref(false) +const dashDensity = ref(3) const showLine = computed(() => { return { type: type.value, polyline: polyline.value, + dashDensity: dashDensity.value, } }) diff --git a/site/.vitepress/components/PlaygroundLink.vue b/site/.vitepress/components/PlaygroundLink.vue index 7c56621..518908c 100644 --- a/site/.vitepress/components/PlaygroundLink.vue +++ b/site/.vitepress/components/PlaygroundLink.vue @@ -1,5 +1,5 @@