@ebiz/designer-components 0.0.18-kzy.3 → 0.0.18-kzy.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/designer-components.css +2 -2
- package/dist/index.mjs +43839 -39549
- package/package.json +1 -1
- package/src/apiService/simpleDataService.js +7 -4
- package/src/components/Button.vue +1 -1
- package/src/components/EbizDetailBlock.vue +82 -0
- package/src/components/EbizDialog.vue +249 -0
- package/src/components/EbizGridEditorSelect.vue +238 -0
- package/src/components/EbizPageHeader.vue +96 -0
- package/src/components/EbizRemoteSelect.vue +7 -5
- package/src/components/EbizTimePicker.vue +144 -0
- package/src/components/EbizTree.vue +153 -0
- package/src/components/EbizTreeSelector.vue +423 -0
- package/src/components/TddesignButton.vue +153 -0
- package/src/components/TdesignUpload.vue +2 -3
- package/src/index.js +17 -1
- package/src/router/index.js +44 -0
- package/src/views/Button.vue +7 -3
- package/src/views/EbizDetailBlockDemo.vue +31 -0
- package/src/views/Home.vue +31 -2
- package/src/views/PageHeaderDemo.vue +105 -0
- package/src/views/TimePickerDemo.vue +147 -0
- package/src/views/TreeDemo.vue +255 -0
- package/src/views/TreeSelectorDemo.vue +246 -0
- package/src/components/Button copy.vue +0 -104
package/src/views/Button.vue
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
<template>
|
2
2
|
<div>
|
3
3
|
<ebiz-route-breadcrumb />
|
4
|
-
<ebiz-button />
|
4
|
+
<ebiz-button :text="测试" :apiConfig="{ apiId: 802, apiType: 5 }" @prepare="onPrepare" />
|
5
5
|
</div>
|
6
6
|
</template>
|
7
7
|
|
@@ -12,9 +12,13 @@ export default {
|
|
12
12
|
name: 'ButtonDemo',
|
13
13
|
components: {
|
14
14
|
EbizButton
|
15
|
+
},
|
16
|
+
methods: {
|
17
|
+
onPrepare() {
|
18
|
+
|
19
|
+
}
|
15
20
|
}
|
16
21
|
}
|
17
22
|
</script>
|
18
23
|
|
19
|
-
<style scoped>
|
20
|
-
</style>
|
24
|
+
<style scoped></style>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<template>
|
2
|
+
<div>
|
3
|
+
<ebiz-route-breadcrumb />
|
4
|
+
<ebiz-detail-block :model="model" :labelMap="labelMap" :gap="10" :labelSize="20" :labelColor="'#000'" :valueSize="20" :valueColor="'#000'"/>
|
5
|
+
</div>
|
6
|
+
</template>
|
7
|
+
|
8
|
+
<script>
|
9
|
+
import { EbizDetailBlock } from '@/index.js'
|
10
|
+
|
11
|
+
export default {
|
12
|
+
name: 'EbizDetailBlockDemo',
|
13
|
+
components: {
|
14
|
+
EbizDetailBlock
|
15
|
+
},
|
16
|
+
data() {
|
17
|
+
return {
|
18
|
+
model: {
|
19
|
+
"name": "张三",
|
20
|
+
"sex": "男"
|
21
|
+
},
|
22
|
+
labelMap:{
|
23
|
+
"name": "姓名",
|
24
|
+
"sex": "性别"
|
25
|
+
}
|
26
|
+
}
|
27
|
+
},
|
28
|
+
}
|
29
|
+
</script>
|
30
|
+
|
31
|
+
<style scoped></style>
|
package/src/views/Home.vue
CHANGED
@@ -1,12 +1,22 @@
|
|
1
1
|
<template>
|
2
2
|
<div class="home">
|
3
|
-
<h1
|
3
|
+
<h1>Ebiz 组件库</h1>
|
4
4
|
<div class="component-list">
|
5
5
|
<div v-for="(item, index) in components" :key="index" class="component-item">
|
6
6
|
<router-link :to="item.path" class="component-link">
|
7
7
|
{{ item.title }}
|
8
8
|
</router-link>
|
9
9
|
</div>
|
10
|
+
|
11
|
+
<router-link to="/tree-demo" class="component-item">
|
12
|
+
<div class="component-title">树组件</div>
|
13
|
+
<div class="component-desc">用于展示层级结构和操作的组件</div>
|
14
|
+
</router-link>
|
15
|
+
|
16
|
+
<router-link to="/tree-selector-demo" class="component-item">
|
17
|
+
<div class="component-title">树形选择器</div>
|
18
|
+
<div class="component-desc">基于树组件的选择器,支持搜索和多选</div>
|
19
|
+
</router-link>
|
10
20
|
</div>
|
11
21
|
</div>
|
12
22
|
</template>
|
@@ -54,10 +64,15 @@ export default {
|
|
54
64
|
{ path: '/ebiz-employee-info', title: 'Ebiz员工信息组件示例' },
|
55
65
|
{ path: '/tdesign-alert', title: 'TDesign提示组件示例' },
|
56
66
|
{ path: '/tdesign-dialog', title: 'TDesign对话框组件示例' },
|
67
|
+
{ path: '/page-header', title: 'Ebiz页面头部组件示例' },
|
57
68
|
{ path: '/table-demo', title: 'Ebiz表格组件示例' },
|
58
69
|
{ path: '/status-badge', title: 'Ebiz状态标记组件示例' },
|
70
|
+
{ path: '/ebiz-detail-block', title: 'Ebiz详情块组件示例' },
|
59
71
|
{ path: '/table-column', title: 'Ebiz表格列组件示例' },
|
60
|
-
{ path: '/table-sort', title: 'Ebiz表格排序组件示例' }
|
72
|
+
{ path: '/table-sort', title: 'Ebiz表格排序组件示例' },
|
73
|
+
{ path: '/tree', title: 'Ebiz树组件示例' },
|
74
|
+
{ path: '/tree-selector', title: 'Ebiz树选择器组件示例' },
|
75
|
+
{ path: '/time-picker', title: 'Ebiz时间选择器组件示例' }
|
61
76
|
]
|
62
77
|
|
63
78
|
return {
|
@@ -95,4 +110,18 @@ export default {
|
|
95
110
|
.component-link:hover {
|
96
111
|
color: #1890ff;
|
97
112
|
}
|
113
|
+
|
114
|
+
.component-title {
|
115
|
+
font-size: 16px;
|
116
|
+
font-weight: bold;
|
117
|
+
margin-bottom: 10px;
|
118
|
+
}
|
119
|
+
|
120
|
+
.component-desc {
|
121
|
+
font-size: 14px;
|
122
|
+
}
|
123
|
+
|
124
|
+
.component-item:hover {
|
125
|
+
background-color: #e6e6e6;
|
126
|
+
}
|
98
127
|
</style>
|
@@ -0,0 +1,105 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="demo-container">
|
3
|
+
<h2>页面头部组件演示</h2>
|
4
|
+
|
5
|
+
<div class="section">
|
6
|
+
<h3>基础用法</h3>
|
7
|
+
<div class="example">
|
8
|
+
<EbizPageHeader />
|
9
|
+
</div>
|
10
|
+
<div class="code">
|
11
|
+
<pre><code><EbizPageHeader /></code></pre>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<div class="section">
|
16
|
+
<h3>功能说明</h3>
|
17
|
+
<div class="description">
|
18
|
+
<p>此组件会自动根据当前路由信息生成面包屑导航。确保路由配置中包含以下meta信息:</p>
|
19
|
+
<pre><code>
|
20
|
+
// 路由配置示例
|
21
|
+
{
|
22
|
+
path: '/hr',
|
23
|
+
component: HR,
|
24
|
+
meta: {
|
25
|
+
title: '人事管理', // 面包屑显示的标题
|
26
|
+
icon: 'user' // 面包屑的图标名称,使用TDesign图标
|
27
|
+
},
|
28
|
+
children: [
|
29
|
+
{
|
30
|
+
path: 'employee',
|
31
|
+
component: Employee,
|
32
|
+
meta: {
|
33
|
+
title: '员工管理',
|
34
|
+
icon: 'user-talk'
|
35
|
+
}
|
36
|
+
}
|
37
|
+
]
|
38
|
+
}
|
39
|
+
</code></pre>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div class="section">
|
44
|
+
<h3>帮助文档跳转</h3>
|
45
|
+
<p>点击帮助文档按钮会自动跳转到 /help 路径,并带上当前路由作为查询参数。</p>
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
</template>
|
49
|
+
|
50
|
+
<script setup>
|
51
|
+
import { EbizPageHeader } from '../index.js'
|
52
|
+
</script>
|
53
|
+
|
54
|
+
<style scoped>
|
55
|
+
.demo-container {
|
56
|
+
padding: 20px;
|
57
|
+
max-width: 1200px;
|
58
|
+
margin: 0 auto;
|
59
|
+
}
|
60
|
+
|
61
|
+
h2 {
|
62
|
+
margin-bottom: 24px;
|
63
|
+
font-weight: 500;
|
64
|
+
color: #1a1a1a;
|
65
|
+
}
|
66
|
+
|
67
|
+
.section {
|
68
|
+
margin-bottom: 32px;
|
69
|
+
border: 1px solid #e9e9e9;
|
70
|
+
border-radius: 4px;
|
71
|
+
overflow: hidden;
|
72
|
+
}
|
73
|
+
|
74
|
+
h3 {
|
75
|
+
padding: 16px;
|
76
|
+
margin: 0;
|
77
|
+
font-weight: 500;
|
78
|
+
background-color: #f7f7f7;
|
79
|
+
border-bottom: 1px solid #e9e9e9;
|
80
|
+
}
|
81
|
+
|
82
|
+
.example {
|
83
|
+
padding: 24px;
|
84
|
+
border-bottom: 1px dashed #e9e9e9;
|
85
|
+
}
|
86
|
+
|
87
|
+
.code {
|
88
|
+
padding: 16px;
|
89
|
+
background-color: #f7f7f7;
|
90
|
+
}
|
91
|
+
|
92
|
+
pre {
|
93
|
+
margin: 0;
|
94
|
+
overflow-x: auto;
|
95
|
+
}
|
96
|
+
|
97
|
+
code {
|
98
|
+
font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
|
99
|
+
font-size: 14px;
|
100
|
+
}
|
101
|
+
|
102
|
+
.description {
|
103
|
+
padding: 16px;
|
104
|
+
}
|
105
|
+
</style>
|
@@ -0,0 +1,147 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="time-picker-demo">
|
3
|
+
<h2>时间选择器 EbizTimePicker</h2>
|
4
|
+
|
5
|
+
<h3>基本用法</h3>
|
6
|
+
<div class="demo-section">
|
7
|
+
<EbizTimePicker v-model="value1" placeholder="请选择时间" />
|
8
|
+
<div class="demo-value">选中值: {{ value1 }}</div>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<h3>时间格式</h3>
|
12
|
+
<div class="demo-section">
|
13
|
+
<EbizTimePicker v-model="value2" format="HH:mm" placeholder="时分格式 HH:mm" />
|
14
|
+
<div class="demo-value">选中值: {{ value2 }}</div>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<h3>禁用状态</h3>
|
18
|
+
<div class="demo-section">
|
19
|
+
<EbizTimePicker v-model="value3" disabled placeholder="禁用状态" />
|
20
|
+
</div>
|
21
|
+
|
22
|
+
<h3>时间范围选择</h3>
|
23
|
+
<div class="demo-section">
|
24
|
+
<EbizTimePicker v-model="value4" range placeholder="请选择时间范围" />
|
25
|
+
<div class="demo-value">选中值: {{ value4 }}</div>
|
26
|
+
</div>
|
27
|
+
|
28
|
+
<h3>步长设置</h3>
|
29
|
+
<div class="demo-section">
|
30
|
+
<EbizTimePicker v-model="value5" :steps="[2, 10, 15]" placeholder="步长:时(2) 分(10) 秒(15)" />
|
31
|
+
<div class="demo-value">选中值: {{ value5 }}</div>
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<h3>禁用时间</h3>
|
35
|
+
<div class="demo-section">
|
36
|
+
<EbizTimePicker v-model="value6" :disable-time="disableTime" placeholder="上午禁用" />
|
37
|
+
<div class="demo-value">选中值: {{ value6 }}</div>
|
38
|
+
</div>
|
39
|
+
|
40
|
+
<h3>不同尺寸</h3>
|
41
|
+
<div class="demo-section">
|
42
|
+
<div class="size-row">
|
43
|
+
<EbizTimePicker v-model="value7" size="small" placeholder="小尺寸" />
|
44
|
+
<EbizTimePicker v-model="value7" size="medium" placeholder="中尺寸(默认)" />
|
45
|
+
<EbizTimePicker v-model="value7" size="large" placeholder="大尺寸" />
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
|
49
|
+
<h3>提示信息</h3>
|
50
|
+
<div class="demo-section">
|
51
|
+
<EbizTimePicker v-model="value8" tips="这是一个提示文本" placeholder="带提示信息" />
|
52
|
+
</div>
|
53
|
+
|
54
|
+
<h3>前置/后置插槽</h3>
|
55
|
+
<div class="demo-section">
|
56
|
+
<EbizTimePicker v-model="value9" placeholder="带前置内容">
|
57
|
+
<template #prepend>
|
58
|
+
<span class="prepend-content">时间:</span>
|
59
|
+
</template>
|
60
|
+
</EbizTimePicker>
|
61
|
+
</div>
|
62
|
+
</div>
|
63
|
+
</template>
|
64
|
+
|
65
|
+
<script setup>
|
66
|
+
import { ref } from 'vue';
|
67
|
+
import { EbizTimePicker } from '../index.js';
|
68
|
+
|
69
|
+
// 基本用法
|
70
|
+
const value1 = ref('');
|
71
|
+
|
72
|
+
// 时间格式
|
73
|
+
const value2 = ref('');
|
74
|
+
|
75
|
+
// 禁用状态
|
76
|
+
const value3 = ref('12:30:00');
|
77
|
+
|
78
|
+
// 时间范围选择
|
79
|
+
const value4 = ref(['09:00:00', '18:00:00']);
|
80
|
+
|
81
|
+
// 步长设置
|
82
|
+
const value5 = ref('');
|
83
|
+
|
84
|
+
// 禁用时间
|
85
|
+
const value6 = ref('');
|
86
|
+
const disableTime = (h) => {
|
87
|
+
// 禁用上午时间段 (0-12点)
|
88
|
+
return h < 12;
|
89
|
+
};
|
90
|
+
|
91
|
+
// 不同尺寸
|
92
|
+
const value7 = ref('');
|
93
|
+
|
94
|
+
// 提示信息
|
95
|
+
const value8 = ref('');
|
96
|
+
|
97
|
+
// 前置/后置插槽
|
98
|
+
const value9 = ref('');
|
99
|
+
</script>
|
100
|
+
|
101
|
+
<style scoped>
|
102
|
+
.time-picker-demo {
|
103
|
+
padding: 20px;
|
104
|
+
max-width: 800px;
|
105
|
+
margin: 0 auto;
|
106
|
+
}
|
107
|
+
|
108
|
+
h2 {
|
109
|
+
margin-bottom: 30px;
|
110
|
+
font-weight: 500;
|
111
|
+
border-bottom: 1px solid #eee;
|
112
|
+
padding-bottom: 10px;
|
113
|
+
}
|
114
|
+
|
115
|
+
h3 {
|
116
|
+
margin-top: 30px;
|
117
|
+
margin-bottom: 15px;
|
118
|
+
font-weight: 400;
|
119
|
+
font-size: 18px;
|
120
|
+
color: #333;
|
121
|
+
}
|
122
|
+
|
123
|
+
.demo-section {
|
124
|
+
margin-bottom: 30px;
|
125
|
+
padding: 20px;
|
126
|
+
background-color: #f9f9f9;
|
127
|
+
border-radius: 4px;
|
128
|
+
}
|
129
|
+
|
130
|
+
.demo-value {
|
131
|
+
margin-top: 10px;
|
132
|
+
color: #606060;
|
133
|
+
font-size: 14px;
|
134
|
+
padding: 5px 0;
|
135
|
+
}
|
136
|
+
|
137
|
+
.size-row {
|
138
|
+
display: flex;
|
139
|
+
gap: 20px;
|
140
|
+
align-items: center;
|
141
|
+
}
|
142
|
+
|
143
|
+
.prepend-content {
|
144
|
+
padding: 0 10px;
|
145
|
+
color: #0052D9;
|
146
|
+
}
|
147
|
+
</style>
|
@@ -0,0 +1,255 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="tree-demo">
|
3
|
+
<h1>树组件示例</h1>
|
4
|
+
|
5
|
+
<h2>基础树</h2>
|
6
|
+
<div class="demo-section">
|
7
|
+
<EbizTree :items="treeData" />
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<h2>可选择的树</h2>
|
11
|
+
<div class="demo-section">
|
12
|
+
<EbizTree :items="treeData" checkable v-model="checkedValue" @change="handleChange" />
|
13
|
+
<div class="result-panel">
|
14
|
+
<p>当前选中值: {{ checkedValue.join(', ') }}</p>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<h2>带禁用节点的树</h2>
|
19
|
+
<div class="demo-section">
|
20
|
+
<EbizTree :items="treeData" checkable :disable-check="disableTreeNode" />
|
21
|
+
<div class="description">
|
22
|
+
<p>通过 disableCheck 函数自定义禁用节点,所有值为"1.1"的节点无法被勾选</p>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<h2>带连接线的树</h2>
|
27
|
+
<div class="demo-section">
|
28
|
+
<EbizTree :items="treeData" line v-model:expanded="expandedNodes" />
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<h2>启用动画效果的树</h2>
|
32
|
+
<div class="demo-section">
|
33
|
+
<EbizTree :items="treeData" line :transition="true" />
|
34
|
+
<div class="description">
|
35
|
+
<p>启用节点展开/收起的过渡动画效果</p>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<h2>可拖拽的树</h2>
|
40
|
+
<div class="demo-section">
|
41
|
+
<EbizTree
|
42
|
+
:items="treeData"
|
43
|
+
draggable
|
44
|
+
@drag-drop="handleDragDrop"
|
45
|
+
/>
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<h2>自定义图标的树</h2>
|
49
|
+
<div class="demo-section">
|
50
|
+
<EbizTree :items="treeData" line>
|
51
|
+
<template #icon="{ node }">
|
52
|
+
<span v-if="node.children && node.children.length">📁</span>
|
53
|
+
<span v-else>📄</span>
|
54
|
+
</template>
|
55
|
+
</EbizTree>
|
56
|
+
</div>
|
57
|
+
|
58
|
+
<h2>节点操作</h2>
|
59
|
+
<div class="demo-section">
|
60
|
+
<EbizTree :items="operableTreeData" line>
|
61
|
+
<template #operations="{ node }">
|
62
|
+
<div class="node-operations">
|
63
|
+
<button @click.stop="addChildNode(node)">添加</button>
|
64
|
+
<button @click.stop="removeNode(node)">删除</button>
|
65
|
+
</div>
|
66
|
+
</template>
|
67
|
+
</EbizTree>
|
68
|
+
</div>
|
69
|
+
</div>
|
70
|
+
</template>
|
71
|
+
|
72
|
+
<script setup>
|
73
|
+
import { ref } from 'vue';
|
74
|
+
import { EbizTree } from '../index.js';
|
75
|
+
|
76
|
+
// 树的数据
|
77
|
+
const treeData = ref([
|
78
|
+
{
|
79
|
+
label: '节点1',
|
80
|
+
value: '1',
|
81
|
+
children: [
|
82
|
+
{
|
83
|
+
label: '节点1.1',
|
84
|
+
value: '1.1',
|
85
|
+
children: [
|
86
|
+
{
|
87
|
+
label: '节点1.1.1',
|
88
|
+
value: '1.1.1'
|
89
|
+
},
|
90
|
+
{
|
91
|
+
label: '节点1.1.2',
|
92
|
+
value: '1.1.2'
|
93
|
+
}
|
94
|
+
]
|
95
|
+
},
|
96
|
+
{
|
97
|
+
label: '节点1.2',
|
98
|
+
value: '1.2'
|
99
|
+
}
|
100
|
+
]
|
101
|
+
},
|
102
|
+
{
|
103
|
+
label: '节点2',
|
104
|
+
value: '2',
|
105
|
+
children: [
|
106
|
+
{
|
107
|
+
label: '节点2.1',
|
108
|
+
value: '2.1'
|
109
|
+
},
|
110
|
+
{
|
111
|
+
label: '节点2.2',
|
112
|
+
value: '2.2'
|
113
|
+
}
|
114
|
+
]
|
115
|
+
}
|
116
|
+
]);
|
117
|
+
|
118
|
+
// 禁用特定节点选择的函数
|
119
|
+
const disableTreeNode = (node) => {
|
120
|
+
return node.value === '1.1';
|
121
|
+
};
|
122
|
+
|
123
|
+
// 可操作的树数据
|
124
|
+
const operableTreeData = ref([
|
125
|
+
{
|
126
|
+
label: '节点1',
|
127
|
+
value: '1',
|
128
|
+
children: [
|
129
|
+
{
|
130
|
+
label: '节点1.1',
|
131
|
+
value: '1.1'
|
132
|
+
}
|
133
|
+
]
|
134
|
+
},
|
135
|
+
{
|
136
|
+
label: '节点2',
|
137
|
+
value: '2',
|
138
|
+
children: []
|
139
|
+
}
|
140
|
+
]);
|
141
|
+
|
142
|
+
// 选中的值
|
143
|
+
const checkedValue = ref([]);
|
144
|
+
|
145
|
+
// 展开的节点
|
146
|
+
const expandedNodes = ref(['1', '1.1']);
|
147
|
+
|
148
|
+
// 选中值变化处理
|
149
|
+
const handleChange = (values, context) => {
|
150
|
+
console.log('选中值变化:', values);
|
151
|
+
console.log('选中上下文:', context);
|
152
|
+
};
|
153
|
+
|
154
|
+
// 拖拽处理
|
155
|
+
const handleDragDrop = (context) => {
|
156
|
+
console.log('拖拽结束:', context);
|
157
|
+
};
|
158
|
+
|
159
|
+
// 添加子节点
|
160
|
+
const addChildNode = (node) => {
|
161
|
+
const newNodeId = `${node.value}-${Date.now()}`;
|
162
|
+
const newNode = {
|
163
|
+
label: `节点${newNodeId}`,
|
164
|
+
value: newNodeId,
|
165
|
+
children: []
|
166
|
+
};
|
167
|
+
|
168
|
+
if (!node.children) {
|
169
|
+
node.children = [];
|
170
|
+
}
|
171
|
+
|
172
|
+
node.children.push(newNode);
|
173
|
+
};
|
174
|
+
|
175
|
+
// 删除节点
|
176
|
+
const removeNode = (node) => {
|
177
|
+
// 找到父节点,从父节点的children中删除当前节点
|
178
|
+
operableTreeData.value = removeNodeByValue(operableTreeData.value, node.value);
|
179
|
+
};
|
180
|
+
|
181
|
+
// 根据值递归删除节点
|
182
|
+
const removeNodeByValue = (nodes, value) => {
|
183
|
+
return nodes.filter(node => {
|
184
|
+
if (node.value === value) {
|
185
|
+
return false;
|
186
|
+
}
|
187
|
+
|
188
|
+
if (node.children && node.children.length) {
|
189
|
+
node.children = removeNodeByValue(node.children, value);
|
190
|
+
}
|
191
|
+
|
192
|
+
return true;
|
193
|
+
});
|
194
|
+
};
|
195
|
+
</script>
|
196
|
+
|
197
|
+
<style scoped>
|
198
|
+
.tree-demo {
|
199
|
+
padding: 20px;
|
200
|
+
|
201
|
+
h1 {
|
202
|
+
margin-bottom: 20px;
|
203
|
+
font-size: 24px;
|
204
|
+
}
|
205
|
+
|
206
|
+
h2 {
|
207
|
+
margin-top: 30px;
|
208
|
+
margin-bottom: 15px;
|
209
|
+
font-size: 20px;
|
210
|
+
}
|
211
|
+
|
212
|
+
.demo-section {
|
213
|
+
margin-bottom: 30px;
|
214
|
+
padding: 20px;
|
215
|
+
border: 1px solid #eee;
|
216
|
+
border-radius: 4px;
|
217
|
+
}
|
218
|
+
|
219
|
+
.result-panel {
|
220
|
+
margin-top: 16px;
|
221
|
+
padding: 10px;
|
222
|
+
background-color: #f5f5f5;
|
223
|
+
border-radius: 4px;
|
224
|
+
|
225
|
+
p {
|
226
|
+
margin: 0;
|
227
|
+
}
|
228
|
+
}
|
229
|
+
|
230
|
+
.node-operations {
|
231
|
+
display: inline-flex;
|
232
|
+
margin-left: 8px;
|
233
|
+
|
234
|
+
button {
|
235
|
+
margin-left: 4px;
|
236
|
+
padding: 2px 6px;
|
237
|
+
font-size: 12px;
|
238
|
+
background-color: #f0f0f0;
|
239
|
+
border: 1px solid #ddd;
|
240
|
+
border-radius: 3px;
|
241
|
+
cursor: pointer;
|
242
|
+
|
243
|
+
&:hover {
|
244
|
+
background-color: #e0e0e0;
|
245
|
+
}
|
246
|
+
}
|
247
|
+
}
|
248
|
+
|
249
|
+
.description {
|
250
|
+
margin-top: 10px;
|
251
|
+
color: #666;
|
252
|
+
font-size: 14px;
|
253
|
+
}
|
254
|
+
}
|
255
|
+
</style>
|