ElementUI组件下拉框绑定点击事件无效的解决方案
在使用脚手架构建的项目中需要使用到下拉组件
<el-dropdown>
<span class="el-dropdown-link" ref="echarType">
柱状图<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown" >
<el-dropdown-item>柱状图</el-dropdown-item>
<el-dropdown-item @click='click'>表格</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
使用这种方式绑定事件无效
正确打开方式 @click.native绑定点击事件
<el-dropdown>
<span class="el-dropdown-link" ref="echarType">
柱状图<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown" >
<el-dropdown-item>柱状图</el-dropdown-item>
<el-dropdown-item @click.native="seeTable">表格</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
转载于:https://blog.csdn.net/marko_zheng/article/details/82454964
感谢原文博主