element 弹出层自定义

263 阅读1分钟

<el-popover :ref="popoverF-${scope.$index}" //关闭按钮 <span class="closePopover" @click="closePopover(scope._self.refs[`popoverF-{scope.$index}`],scope)">

函数:

closePopover(e,obj){ // element内置方法 e.doClose() }

css:

.closePopover { width: 20px; height: 20px; position: relative; }

.closePopover::after { content: '×'; position: absolute; width: 20px; height: 20px; font-size: 20px; line-height: 20px; text-align: center; color: #fff; background-color: #f00; border-radius: 50%; cursor: pointer; }

//{scope.index} 循化使用 必加 不然$el指向最后一个