Skip to content

Commit c800d0d

Browse files
committed
chore: update path to rootPath.
1 parent 16ea14a commit c800d0d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

example/SelectControl.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
<input v-model="state.selectOnClickNode" type="checkbox" />
2727
</div>
2828
<div>
29-
<label>path</label>
30-
<input v-model="state.path" type="text" />
29+
<label>rootPath</label>
30+
<input v-model="state.rootPath" type="text" />
3131
</div>
3232
<div>
3333
<label>showLength</label>
@@ -69,7 +69,7 @@
6969
v-if="state.renderOK"
7070
v-model:selectedValue="state.selectedValue"
7171
:data="state.data"
72-
:path="state.path"
72+
:root-path="state.rootPath"
7373
:deep="state.deep"
7474
:show-double-quotes="true"
7575
:highlight-selected-node="state.highlightSelectedNode"
@@ -140,7 +140,7 @@ export default defineComponent({
140140
highlightSelectedNode: true,
141141
selectOnClickNode: true,
142142
collapsedOnClickBrackets: true,
143-
path: 'res',
143+
rootPath: 'res',
144144
deep: 3,
145145
node: '',
146146
showIcon: false,

src/components/Tree/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default defineComponent({
3333
default: null,
3434
},
3535
// Data root path.
36-
path: {
36+
rootPath: {
3737
type: String,
3838
default: 'root',
3939
},
@@ -229,7 +229,7 @@ export default defineComponent({
229229

230230
const handleValueChange = (value: unknown, path: string) => {
231231
const newData = cloneDeep(props.data);
232-
const rootPath = props.path;
232+
const rootPath = props.rootPath;
233233
new Function('data', 'val', `data${path.slice(rootPath.length)}=val`)(newData, value);
234234
emit('update:data', newData);
235235
};

0 commit comments

Comments
 (0)