ant-design-vue 气泡自定义HTML弹窗

<span slot="manageOptionCodes" slot-scope="manageOptionCodes,record,index">
                        <a-popover placement="bottom">
                            <template slot="content">
                                <p v-html="popover(index)"></p >
                            </template>
                        {
   
   {manageOptionCodes ? manageOptionCodes : '--'}}
                        </a-popover>
                    </span>
     
     
     
// 自定义html的弹窗
            popover(){
                // 上面的index好像是第几个参数就是
                return function (index) {
                    let result = "";
                    if(this.swindleAccountList[index].manageOptionCodes){
                        let manageOptionItems= this.swindleAccountList[index].manageOptionCodes.split(',');
                        manageOptionItems.forEach(item => {
                            let name = (this.swindleAccountInfo.manageOptionItems.find(temp => temp.code === item) || {}).name;
                            result+=`<p>${item}:${name}</p >`
                        })
                        result+=`<p>是否久悬:${this.swindleAccountList[index].hangingLongFlag === 'Y' ? "是" : "否" }</p >`
                    } else {
                       result = '--';
                    }
                    return result;
                }
            }

猜你喜欢

转载自blog.csdn.net/qq_33371766/article/details/114228084