Commit b3dbdba9b3e272b9fe51c57dd61289f086545d21
1 parent
b6b0e9e7
impove table render logic,fix xss.
Showing
1 changed file
with
4 additions
and
1 deletions
Show diff stats
src/components/table/cell.vue
... | ... | @@ -4,7 +4,8 @@ |
4 | 4 | <template v-if="renderType === 'selection'"> |
5 | 5 | <Checkbox :value="checked" @on-change="toggleSelect" :disabled="disabled"></Checkbox> |
6 | 6 | </template> |
7 | - <template v-if="renderType === 'normal'"><span v-html="row[column.key]"></span></template> | |
7 | + <template v-if="renderType === 'html'"><span v-html="row[column.key]"></span></template> | |
8 | + <template v-if="renderType === 'normal'"><span>{{row[column.key]}}</span></template> | |
8 | 9 | </div> |
9 | 10 | </template> |
10 | 11 | <script> |
... | ... | @@ -120,6 +121,8 @@ |
120 | 121 | this.renderType = 'index'; |
121 | 122 | } else if (this.column.type === 'selection') { |
122 | 123 | this.renderType = 'selection'; |
124 | + } else if (this.column.type === 'html') { | |
125 | + this.renderType = 'html'; | |
123 | 126 | } else if (this.column.render) { |
124 | 127 | this.renderType = 'render'; |
125 | 128 | } else { | ... | ... |