第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

element ui的 popover彈出框 設(shè)置v-model屬性來(lái)決定是否顯示不出現(xiàn)彈出框但是

element ui的 popover彈出框 設(shè)置v-model屬性來(lái)決定是否顯示不出現(xiàn)彈出框但是

慕田峪4524236 2019-02-15 19:19:48
項(xiàng)目中有一個(gè)需求,想直接點(diǎn)擊表格的行上的某一列來(lái)直接實(shí)現(xiàn)更改,我用element ui 框架的popover彈出框,然后在設(shè)置v-model="visible2"的時(shí)候,默認(rèn)是false的時(shí)候點(diǎn)擊按鈕,popover彈出框不出現(xiàn),如果不設(shè)置v-model這個(gè)屬性,點(diǎn)擊可以出現(xiàn),不知道這是為什么?直接復(fù)制官網(wǎng)的代碼也一樣的問(wèn)題,誰(shuí)能指教一下呢?<el-table-column label="數(shù)量" width="80" >    <template slot-scope="scope">        <el-popover  ref="popover4"  placement="top" width="160" trigger="click">            <el-input v-model="scope.row.quantity"></el-input>            <div style="margin-top:10px">                <el-button size="mini" style="float:left" @click="cancelChange">取消</el-button>                <el-button size="mini" type="primary" style="float:right" @click="confirmChange(scope.$index, cart_list)">確認(rèn)</el-button>            </div>        </el-popover>        <el-button  v-popover:popover4 type="text" style="width:40px">                     {{scope.row.quantity}}          </el-button>    </template></el-table-column>
查看完整描述

1 回答

?
慕的地6264312

TA貢獻(xiàn)1817條經(jīng)驗(yàn) 獲得超6個(gè)贊

給個(gè)忠告,下次提問(wèn)的時(shí)候,貼出來(lái)的代碼一定要排好版,不然看著這么亂的代碼,回答的心情都沒(méi)了。已經(jīng)手動(dòng)幫你重新排版了下代碼。


說(shuō)正題。

Element UI里的 popover 除了可以使用 v-popover 來(lái)綁定外,還有另一種方式來(lái)實(shí)現(xiàn),如果你稍微認(rèn)真看文檔,肯定能看到下面圖中的內(nèi)容。

https://img1.sycdn.imooc.com//5c7245870001600b08000212.jpg

圖中說(shuō)到的 slot=reference 就可以被利用起來(lái)。像你問(wèn)題中的代碼,就可以這樣寫(xiě)。


<template slot-scope="scope">

    <el-popover placement="top" width="160" trigger="click">

        <el-input v-model="scope.row.quantity"></el-input>

        <div style="margin-top:10px">

            <el-button size="mini" style="float:left" 

                @click="cancelChange">取消</el-button>

            <el-button size="mini" type="primary" 

                style="float:right" 

                @click="confirmChange(scope.$index, cart_list)">確認(rèn)</el-button>

        </div>

        <el-button slot="reference" type="text" style="width:40px">         

            {{scope.row.quantity}}  

        </el-button>

    </el-popover>

</template>


查看完整回答
反對(duì) 回復(fù) 2019-02-24
  • 1 回答
  • 0 關(guān)注
  • 8772 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)