遇到的问题:
我给button绑定了事件,传递了$event ,并在JS中使用,在谷歌、火狐都可正常使用,但是当处于IE浏览器时,button绑定的事件就不会被触发。代码如下:
<Button
type="primary"
size="small"
@click="onAcceptance($event)"
style="margin-left: 20px"
>受理</Button
>
onAcceptance(e) {
this.xzButton = e.target.innerText;
},
原因分析:
经过查询了解,发现IE浏览器不能使用event对象,所以将需要在JS中使用的内容直接下传即可。
解决代码:
<Button
type="primary"
size="small"
@click="onAcceptance('受理')"
style="margin-left: 20px"
>受理</Button
>
onAcceptance(type) {
this.xzButton = type;
},