The el-popover in elementui cannot be displayed normally

Requirements: For the operation column in the table in the front-end daily development, it is often encountered that a prompt box pops up when the button is clicked to remind the user to prevent accidental touch or reconfirmation (such as deletion). To achieve this, el-popover is usually used.

Problem: But el-popover needs to use this v-model two-way binding, but if you write el-popover in el-table directly according to the example in the official document, you will encounter a prompt box that cannot be displayed normally. My understanding should be two-way binding There must be a conflict.

Solution: Dynamically bind a ref to el-popover

code:

html:

js: 

This is the OK button function of el-popover, the same is true for cancel

 You can achieve the normal display of el-popover in each row operation of the elementui table as shown in the figure below

 

 

Guess you like

Origin blog.csdn.net/m0_61676604/article/details/130554046