From 2be8b1687218f274d7f0351fa286acb6b2001881 Mon Sep 17 00:00:00 2001 From: ColMugX Date: Fri, 21 Feb 2020 16:20:56 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E5=88=86=E9=A1=B5=E5=99=A8=E7=9A=84?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=99=A8=E5=8F=AF=E4=BB=A5=E8=A2=AB=E6=B8=85?= =?UTF-8?q?=E7=A9=BA=20(#41)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/pagination/src/pagination.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/pagination/src/pagination.js b/packages/pagination/src/pagination.js index 0fbea454481..381de8245ab 100644 --- a/packages/pagination/src/pagination.js +++ b/packages/pagination/src/pagination.js @@ -176,6 +176,7 @@ export default { popperClass={ this.$parent.popperClass || '' } size="mini" on-input={ this.handleChange } + clearable={false} disabled={ this.$parent.disabled }> { this.pageSizes.map(item => From 6c4d0688f3365444e72a727e2b44443e386234ec Mon Sep 17 00:00:00 2001 From: EVILLT <53422750+eviIIt@users.noreply.github.com> Date: Fri, 21 Feb 2020 16:34:21 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat(edit-table):=20formatter=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E8=BF=94=E5=9B=9E=20`jsx`=20=E5=92=8C=20=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E7=BB=84=E4=BB=B6=20(#40)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): 更新 node-sass node v12 竟然不能运行, 需要降级到 v11 * feat(edit-table): formatter 支持返回 jsx 和自定义显示组件 * style: lint * feat(edit-table): 单元格数据 * docs(edit-table): 改善 edit-table formatter 文档 * refactor(edit-table): 更改为更明确的常量名 * improvement(edit-table): 更名, 调整 formatter 顺序 * docs(edit-table): 调整文档 * docs(edit-table): 使用 cellValue --- examples/docs/zh-CN/edit-table.md | 14 ++++++++--- package.json | 2 +- packages/edit-table/src/form-input.vue | 27 ++++++++++++++++++---- yarn.lock | 32 ++++++++++++++++++++++++-- 4 files changed, 64 insertions(+), 11 deletions(-) diff --git a/examples/docs/zh-CN/edit-table.md b/examples/docs/zh-CN/edit-table.md index c37b058a8c3..02032924a28 100644 --- a/examples/docs/zh-CN/edit-table.md +++ b/examples/docs/zh-CN/edit-table.md @@ -452,7 +452,7 @@ export default { ### 使用formatter函数 -当edit-table使用了readonly状态时,可在字段属性自定义column.formatter。该函数接收row和index参数,需要返回字符串,暂不支持jsx。不定义则默认返回原数据对应的字段。 +当edit-table使用了 `readonly` 状态时,可在字段属性自定义 `column.formatter`。该函数接收 `row`, `cellValue` 和 `index` 参数,可返回 JSX(需要项目配置支持), 自定义组件和字符串。不定义则默认返回原数据对应的字段。 :::demo @@ -485,12 +485,20 @@ export default { } ], }, - {id: 'sex' , label: '性别', type: 'select', el: {placeholder: '选择性别'}, default: 'man', options: [{label: '男', value: 'man'}, {label: '女', value: 'woman'}]}, + { + id: 'sex', + label: '性别', + type: 'select', + el: {placeholder: '选择性别'}, + default: 'man', + options: [{label: '男', value: 'man'}, {label: '女', value: 'woman'}], + formatter: (row, cellValue) => {cellValue} + }, { id: 'readonly', label: '组成句子', type: 'input', - formatter(row, column) { + formatter(row) { return row.name?`${row.name} is a ${row.sex}, ${{man: 'his', woman: 'her'}[row.sex] || 'his'} phone number is ${row.phone}`:'Please Input Name' } } diff --git a/package.json b/package.json index 7674a205fad..98db505703d 100644 --- a/package.json +++ b/package.json @@ -136,7 +136,7 @@ "markdown-it-container": "^2.0.0", "mini-css-extract-plugin": "^0.4.1", "mocha": "^6.0.2", - "node-sass": "^4.11.0", + "node-sass": "^4.13.1", "optimize-css-assets-webpack-plugin": "^5.0.1", "postcss": "^7.0.14", "progress-bar-webpack-plugin": "^1.11.0", diff --git a/packages/edit-table/src/form-input.vue b/packages/edit-table/src/form-input.vue index fe52a776148..bb2adf7e8a6 100644 --- a/packages/edit-table/src/form-input.vue +++ b/packages/edit-table/src/form-input.vue @@ -5,7 +5,7 @@ v-bind="$attrs" :prop="`data.${index}.${column.id}`" > -

{{text}}

+