From 542002bb85466da39b11d81564a5655b4d76a765 Mon Sep 17 00:00:00 2001 From: lijing Date: Tue, 20 Oct 2026 14:46:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(render):=20=E4=BF=AE=E5=A4=8D=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E5=86=85=E7=82=B9=E5=87=BB=E6=97=A0=E5=93=8D=E5=BA=94?= =?UTF-8?q?=EF=BC=88Vue2=20on:{click}=20=E2=86=92=20Vue3=20onClick?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 班级管理「班主任/副班主任/校区」三列、任教管理操作列用的是 h(..., { on: { click: fn } })。Vue3 不再识别 on 对象,事件根本没绑上, 所以点单元格毫无反应。改为顶层 onClick(含带 stopPropagation 的清空按钮), treeMixin 的树节点点击同步修正。 --- src/mixins/treeMixin.js | 6 ++-- src/views/classManage/Christianity.vue | 36 +++++------------------- src/views/teacherManage/teachseeting.vue | 14 ++------- 3 files changed, 12 insertions(+), 44 deletions(-) diff --git a/src/mixins/treeMixin.js b/src/mixins/treeMixin.js index 74d03ef..20905fc 100644 --- a/src/mixins/treeMixin.js +++ b/src/mixins/treeMixin.js @@ -19,11 +19,9 @@ export default { cursor: "pointer", backgroundColor: node.node.selected ? "#e5e5e5" : "" }, - on: { - click: (e) => { - e.stopPropagation() + onClick: (e) => { + e.stopPropagation(); this.$emit("on-tree-change", node.node); - } } }, data.title) ]); diff --git a/src/views/classManage/Christianity.vue b/src/views/classManage/Christianity.vue index f5e7502..80f8340 100644 --- a/src/views/classManage/Christianity.vue +++ b/src/views/classManage/Christianity.vue @@ -365,9 +365,7 @@ style: { width: '150px' }}) cursor: 'pointer', margin: '0 auto' }, - on: { - click: () => this.openTeacherSelect(params.index, 'headTeacher') - } + onClick: () => this.openTeacherSelect(params.index, 'headTeacher') }, [ h('span', { style: { @@ -391,8 +389,7 @@ style: { width: '150px' }}) flexShrink: 0, fontSize: '14px' }, - on: { - click: (e) => { + onClick: (e) => { e.stopPropagation() var item={ id:params.row.id, @@ -407,7 +404,6 @@ style: { width: '150px' }}) } }); } - } }, '×') : null ]) } @@ -428,9 +424,7 @@ style: { width: '150px' }}) cursor: 'pointer', margin: '0 auto' }, - on: { - click: () => this.openTeacherSelect(params.index, 'secondTeacherName') - } + onClick: () => this.openTeacherSelect(params.index, 'secondTeacherName') }, [ h('span', { style: { @@ -454,8 +448,7 @@ style: { width: '150px' }}) flexShrink: 0, fontSize: '14px' }, - on: { - click: (e) => { + onClick: (e) => { e.stopPropagation() var item={ id:params.row.id, @@ -470,7 +463,6 @@ style: { width: '150px' }}) } }); } - } }, '×') : null ]) } @@ -491,9 +483,7 @@ style: { width: '150px' }}) cursor: 'pointer', margin: '0 auto' }, - on: { - click: () => this.openCampusSelect(params.index) - } + onClick: () => this.openCampusSelect(params.index) }, [ h('span', { style: { @@ -517,8 +507,7 @@ style: { width: '150px' }}) flexShrink: 0, fontSize: '14px' }, - on: { - click: (e) => { + onClick: (e) => { e.stopPropagation() var item={ id:params.row.id, @@ -533,7 +522,6 @@ style: { width: '150px' }}) } }); } - } }, '×') : null ]) } @@ -726,17 +714,7 @@ onClick: () => this.deleteRow(params.index, params.row)})