赞
踩
在使用脚手架构建的项目中需要使用到下拉组建
<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>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。