Skip to content

Commit 8d8cbf6

Browse files
committed
fix/xss-vulnerability
1 parent 6760219 commit 8d8cbf6

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/components/TreeNode/index.vue

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
@click="onBracketsClick"
3434
/>
3535

36-
<span v-else :class="valueClass" v-html="valueFormatter(node.content)" />
36+
<span v-else-if="customValueFormatter" v-html="customFormatter(node.content)"></span>
37+
<span v-else :class="valueClass" v-text="defaultFormatter(node.content)" />
3738

3839
<span v-if="showLength && collapsed" class="vjs-comment"> // {{ node.length }} items </span>
3940
</span>
@@ -134,15 +135,13 @@ export default {
134135
return text;
135136
},
136137
137-
valueFormatter(data) {
138-
const basic = this.customValueFormatter
139-
? this.customValueFormatter(
140-
data,
141-
this.node.key,
142-
this.node.path,
143-
this.defaultFormatter(data),
144-
)
145-
: this.defaultFormatter(data);
138+
customFormatter(data) {
139+
const basic = this.customValueFormatter(
140+
data,
141+
this.node.key,
142+
this.node.path,
143+
this.defaultFormatter(data),
144+
);
146145
147146
return this.node.showComma ? `${basic},` : basic;
148147
},

0 commit comments

Comments
 (0)