el-popover自主控制顯示和收起的方法

huanxiaD發表於2020-12-27
<el-popover
      v-if="gridData.length>1"
      placement="bottom"
      width="600"
      ref="gridTable"
      popper-class="gridData_sty"
      style="max-height:300px;"
      trigger="click">
      <el-button slot="reference" type="primary" style="float:right;" size="mini">檢視全部表</el-button>
    </el-popover>

收起和展開分別用 doClose 和 doShow

this.$nextTick(()=>{
  console.log('this.$refs.gridTable',this.$refs.gridTable)
  this.$refs.gridTable.doShow()
   //this.$refs.gridTable.doClose()
})

相關文章