fix(tree): fix tree theme for content-right, add tree docs (#2035)

This commit is contained in:
申君健 2024-09-04 11:19:29 +08:00 committed by GitHub
parent f1acc9999e
commit f9d51b2e2e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 27 additions and 4 deletions

View File

@ -8,7 +8,14 @@
<tiny-button @click="editNode">编辑节点</tiny-button>
<tiny-button @click="saveNode">5s后保存节点</tiny-button> <br />
<br />
<tiny-tree ref="treeRef" node-key="id" :data="data" current-node-key="1" default-expand-all></tiny-tree>
<tiny-tree
ref="treeRef"
show-checkbox
node-key="id"
:data="data"
current-node-key="1"
default-expand-all
></tiny-tree>
</div>
</template>
@ -20,6 +27,7 @@ const data = ref([
{
id: '1',
label: '数据 1',
disabled: true,
children: [
{ id: '1-1', label: '数据 1-1', children: [{ id: '1-1-1', label: '数据 1-1-1' }] },
{ id: '1-2', label: '数据 1-2' }

View File

@ -8,7 +8,14 @@
<tiny-button @click="editNode">编辑节点</tiny-button>
<tiny-button @click="saveNode">5s后保存节点</tiny-button> <br />
<br />
<tiny-tree ref="treeRef" node-key="id" :data="data" current-node-key="1" default-expand-all></tiny-tree>
<tiny-tree
ref="treeRef"
show-checkbox
node-key="id"
:data="data"
current-node-key="1"
default-expand-all
></tiny-tree>
</div>
</template>
@ -26,6 +33,7 @@ export default {
{
id: '1',
label: '数据 1',
disabled: true,
children: [
{ id: '1-1', label: '数据 1-1', children: [{ id: '1-1-1', label: '数据 1-1-1' }] },
{ id: '1-2', label: '数据 1-2' }

View File

@ -410,7 +410,8 @@ export default {
通过调用实例的<code> editNode(node) </code> node <br>
通过调用实例的<code> saveNode() </code><br>
<div class="tip custom-block">
在使用编辑功能时不要使用 <code> props </code> 使
在使用编辑功能时不要使用 <code> props </code> 使<br>
数据项的禁用并不影响数据的编辑功能编辑功能的控制请参考 <code> 编辑权限 </code>
</div>
通过<code> edit-config </code> <br>
`,
@ -419,7 +420,8 @@ export default {
Edit the node node immediately by calling the instance's <code> editNode(node) </code> method. <br>
Save the node being edited by calling the instance's <code> saveNode() </code> method. <br>
<div class="tip custom-block">
When using the editing functions, do not use <code> props </code> to define the mapping of data columns. Instead, use the default data format.
When using the editing functions, do not use <code> props </code> to define the mapping of data columns. Instead, use the default data format.<br>
Disabling the data item does not affect the data editing function. For details about how to control the editing function, see the example of <code> editing permission </code>.
</div>
Set parameters in editing mode through the <code>edit-config </code> attribute.<br>
`

View File

@ -365,6 +365,10 @@
align-items: center;
padding-left: calc(var(--ti-tree-node-label-margin-left) / 2);
padding-right: var(--ti-tree-node-content-padding-right);
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
@ -386,6 +390,7 @@
display: flex;
align-items: center;
height: 100%;
cursor: pointer;
svg {
fill: var(--ti-tree-node-operate-icon-color);