From 0f812e78ad399eacb43d8c6ac5d815ff6dd3c50c Mon Sep 17 00:00:00 2001 From: luanhualiang Date: Fri, 14 Aug 2020 13:00:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9B=B4=E5=A4=9A=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E6=B4=BE=E5=8F=91=EF=BC=8C=E4=BB=A3=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=A2=9E=E5=8A=A0=E6=B3=A8=E9=87=8A=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 12 +++++- src/components/index.vue | 57 +++++++++++++++++---------- src/core/Body.js | 41 +++++++++++++++++-- src/core/Cell.js | 11 +++++- src/core/Clipboard.js | 32 +++++++-------- src/core/ColumnHeader.js | 4 +- src/core/Context.js | 1 + src/core/DataGrid.js | 85 ++++++++++++++++++++++------------------ src/core/Events.js | 46 +++++++++++++--------- src/core/Row.js | 14 +++---- src/core/RowHeader.js | 2 +- src/core/Validator.js | 18 ++++++--- src/core/constants.js | 37 ++++++++--------- 13 files changed, 227 insertions(+), 133 deletions(-) diff --git a/src/App.vue b/src/App.vue index 150c24c..b5116f5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -27,7 +27,9 @@ :data="gridData" :fixed-left="2" :fixed-right="1" - @on-update="onUpdate" + @after-edit-cell="afterEditCell" + @after-autofill="afterAutofill" + @after-paste="afterPaste" > @@ -88,7 +90,13 @@ export default { ] this.$refs.datagrid.updateData(data); }, - onUpdate(data) { + afterEditCell(data) { + console.log(data) + }, + afterAutofill(data) { + console.log(data) + }, + afterPaste(data) { console.log(data) }, getCheckedRows() { diff --git a/src/components/index.vue b/src/components/index.vue index 56b034c..2e3013a 100644 --- a/src/components/index.vue +++ b/src/components/index.vue @@ -16,7 +16,9 @@ contenteditable="true" v-show="isSimple" @input="inputHandler" - @keydown.tab.prevent @keydown.enter.prevent @keydown.esc.prevent + @keydown.tab.prevent + @keydown.enter.prevent + @keydown.esc.prevent > + ref="cascader" + v-else-if="dataType==='cascader'" + :class="`${CSS_PREFIX}-popup`" + :style="popupSty" + v-model="cascader_value" + size="medium" + :options="selectOptions" + @change="selectChange"> + --> @@ -99,9 +101,9 @@