ElementUI的el-popover在表格中使用气泡框无法展示
ElementUI的el-popover在表格中使用气泡框无法展示
官方给出的示例在,表格中无法使用,原因是双向绑定重复了,我们可以添加一个ref
<el-popover
placement="top"
width="160"
:ref="`popover-${scope.$index}`"
>
<p>确定修改状态为已做吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="cancelPopover(scope.$index)">取消</el-button>
<el-button type="primary" size="mini" @click="definePopover(scope.row,scope.$index)">确定</el-button>
</div>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
slot="reference">已做</el-button>
</el-popover>
/**取消展示Popover*/
cancelPopover(index){
this.$refs[`popover-${index}`].doClose();
},
/**Popover点击确认*/
definePopover(row,index){
//提交信息
//关闭气泡框
this.$refs[`popover-${index}`].doClose();
}
评论
匿名评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果