小码问答,有问必答!

2022-12-19 16:57

runtime-core.esm-bundler.js:38 [Vue warn]: Unhandled error during execution of native event handler

2022-12-19 16:57 回答了这个问题

runtime-core.esm-bundler.js:38 [Vue warn]: Unhandled error during execution of native event handler 

  at <ElRadioButton label="显示A信息" onClick=fn<handleShowBuilding> > 

  at <ElRadioGroup modelValue="显示B信息" onUpdate:modelValue=fn > 

  at <Item style= {paddingBottom: '0px', marginRight: '8px'} prefixCls=undefined key="LoopKey1" > 

  at <ElSpace key=0 > 

  at <ElCol class="buildingpanel" > 

  at <ElRow> 

  at <ElHeader> 

  at <ElContainer key="condo" > 

  at <ElContainer> 

  at <GridIndex onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< Proxy {__v_skip: true} > key="/village/desktop/gridindex" > 

  at <KeepAlive include= (2) ['Index', 'Gridindex'] > 

  at <BaseTransition mode="out-in" appear=false persisted=false  ... > 

  at <Transition name="fade-transform" mode="out-in" > 

  at <RouterView> 

  at <AppMain> 

  at <Index onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< Proxy {__v_skip: true} > > 

  at <RouterView> 

  at <App>


@click方法如果要添加至组件上,需要加上native,等同于在子组件中,子组件内部处理click事件然后向外发送click事件:$emit(“click”.fn),@click.native会触发两次click事件,原因是el-radio-button是封装过的,由input和label标签组成,在这个组件上添加单纯的click事件,所以会触发两个组件的click;所以你需要在你的方法中添加event参数,跟参数的值判断哪次点击生效,从而避免其中请求会请求两次的问题。

0条评论

我要评论