Commit 429479a53b76ecf97cda9575addbb3ed1ce93231
Committed by
GitHub
Merge pull request #993 from anykno/table_render
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,7 +4,8 @@ | ||
4 | <template v-if="renderType === 'selection'"> | 4 | <template v-if="renderType === 'selection'"> |
5 | <Checkbox :value="checked" @click.native.stop="handleClick" @on-change="toggleSelect" :disabled="disabled"></Checkbox> | 5 | <Checkbox :value="checked" @click.native.stop="handleClick" @on-change="toggleSelect" :disabled="disabled"></Checkbox> |
6 | </template> | 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 | <template v-if="renderType === 'expand' && !row._disableExpand"> | 9 | <template v-if="renderType === 'expand' && !row._disableExpand"> |
9 | <div :class="expandCls" @click="toggleExpand"> | 10 | <div :class="expandCls" @click="toggleExpand"> |
10 | <Icon type="ios-arrow-right"></Icon> | 11 | <Icon type="ios-arrow-right"></Icon> |
@@ -83,6 +84,8 @@ | @@ -83,6 +84,8 @@ | ||
83 | this.renderType = 'index'; | 84 | this.renderType = 'index'; |
84 | } else if (this.column.type === 'selection') { | 85 | } else if (this.column.type === 'selection') { |
85 | this.renderType = 'selection'; | 86 | this.renderType = 'selection'; |
87 | + } else if (this.column.type === 'html') { | ||
88 | + this.renderType = 'html'; | ||
86 | } else if (this.column.type === 'expand') { | 89 | } else if (this.column.type === 'expand') { |
87 | this.renderType = 'expand'; | 90 | this.renderType = 'expand'; |
88 | } else if (this.column.render) { | 91 | } else if (this.column.render) { |