File tree Expand file tree Collapse file tree
packages/plugins/page/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 @drop =" handleDrop($event, node)"
2626 @dragend =" handleDragEnd"
2727 >
28- <div class =" content" @click =" handleClickRow(node)" >
28+ <div class =" content" @click =" handleClickRow($event, node)" >
2929 <layer-lines :line-data =" layerLine[rowIndex]" :level =" node.level" ></layer-lines >
30- <div class =" prefix-icon" @click.stop =" handleSwitchCollapse(node)" >
30+ <div class =" prefix-icon" @click =" handleSwitchCollapse(node)" >
3131 <svg-icon v-if =" node.rawData.isPage" :name =" collapseMap[node.id] ? 'page-collection' : 'page'" ></svg-icon >
3232 <svg-icon v-else :name =" collapseMap[node.id] ? 'folder' : 'folder-wold'" ></svg-icon >
3333 </div >
@@ -193,7 +193,13 @@ const layerLine = computed(() => {
193193 return result
194194})
195195
196- const handleClickRow = (node ) => {
196+ const handleClickRow = (event , node ) => {
197+ // 点击事件来自折叠图标,不触发 clickRow 事件。点击事件仍然可以冒泡
198+ const currentTarget = event .currentTarget as HTMLElement
199+ if (currentTarget .querySelector (' div.prefix-icon' )?.contains (event .target )) {
200+ return
201+ }
202+
197203 emit (' clickRow' , node )
198204}
199205
You can’t perform that action at this time.
0 commit comments