Commit 429479a53b76ecf97cda9575addbb3ed1ce93231

Authored by Aresn
Committed by GitHub
2 parents 7b048668 8e9002b9

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 4 <template v-if="renderType === 'selection'">
5 5 <Checkbox :value="checked" @click.native.stop="handleClick" @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 <template v-if="renderType === 'expand' && !row._disableExpand">
9 10 <div :class="expandCls" @click="toggleExpand">
10 11 <Icon type="ios-arrow-right"></Icon>
... ... @@ -83,6 +84,8 @@
83 84 this.renderType = 'index';
84 85 } else if (this.column.type === 'selection') {
85 86 this.renderType = 'selection';
  87 + } else if (this.column.type === 'html') {
  88 + this.renderType = 'html';
86 89 } else if (this.column.type === 'expand') {
87 90 this.renderType = 'expand';
88 91 } else if (this.column.render) {
... ...