Element Popover 彈出框的使用示例
組件— 彈出框
基礎(chǔ)用法

<template>
<el-popover
placement="top-start"
title="標(biāo)題"
width="200"
trigger="hover"
content="這是一段內(nèi)容,這是一段內(nèi)容,這是一段內(nèi)容,這是一段內(nèi)容。">
<el-button slot="reference">hover 激活</el-button>
</el-popover>
<el-popover
placement="bottom"
title="標(biāo)題"
width="200"
trigger="click"
content="這是一段內(nèi)容,這是一段內(nèi)容,這是一段內(nèi)容,這是一段內(nèi)容。">
<el-button slot="reference">click 激活</el-button>
</el-popover>
<el-popover
ref="popover"
placement="right"
title="標(biāo)題"
width="200"
trigger="focus"
content="這是一段內(nèi)容,這是一段內(nèi)容,這是一段內(nèi)容,這是一段內(nèi)容。">
</el-popover>
<el-button v-popover:popover>focus 激活</el-button>
<el-popover
placement="bottom"
title="標(biāo)題"
width="200"
trigger="manual"
content="這是一段內(nèi)容,這是一段內(nèi)容,這是一段內(nèi)容,這是一段內(nèi)容。"
v-model="visible">
<el-button slot="reference" @click="visible = !visible">手動(dòng)激活</el-button>
</el-popover>
</template>
<script>
export default {
data() {
return {
visible: false
};
}
};
</script>
嵌套信息

<el-popover
placement="right"
width="400"
trigger="click">
<el-table :data="gridData">
<el-table-column width="150" property="date" label="日期"></el-table-column>
<el-table-column width="100" property="name" label="姓名"></el-table-column>
<el-table-column width="300" property="address" label="地址"></el-table-column>
</el-table>
<el-button slot="reference">click 激活</el-button>
</el-popover>
<script>
export default {
data() {
return {
gridData: [{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀區(qū)金沙江路 1518 弄'
}, {
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀區(qū)金沙江路 1518 弄'
}, {
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀區(qū)金沙江路 1518 弄'
}, {
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀區(qū)金沙江路 1518 弄'
}]
};
}
};
</script>
嵌套操作

<el-popover
placement="top"
width="160"
v-model="visible">
<p>這是一段內(nèi)容這是一段內(nèi)容確定刪除嗎?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="visible = false">確定</el-button>
</div>
<el-button slot="reference">刪除</el-button>
</el-popover>
<script>
export default {
data() {
return {
visible: false,
};
}
}
</script>
Attributes


Slot

Events

Element-UI表格點(diǎn)擊Popover 彈出框確定取消

<el-table-column width="600">
<template slot-scope="scope">
<el-popover trigger="click" placement="top" width="450" @show="handleStatus(scope)" :ref="`popover-${scope.$index}`">
<div>
<el-input type="textarea" :rows="5" maxlength="300" placeholder="請輸入內(nèi)容" v-model="scope.row.spaceAllocatePrice"></el-input>
</div>
<div style="text-align: left; margin-top: 20px">
<el-button size="small" plain @click="cancelClick(scope)">取消</el-button>
<el-button type="primary" size="small" @click="sureClick(scope)">確定</el-button>
</div>
<el-button slot="reference" type="text">說明</el-button>
</el-popover>
</template>
</el-table-column>
cancelClick(scope){
this.$message('點(diǎn)擊了取消操作');
scope._self.$refs[`popover-${scope.$index}`].doClose()
},
sureClick(scope){
// 可以在這里執(zhí)行刪除數(shù)據(jù)的回調(diào)操作.......刪除操作......
this.$message({
message:"點(diǎn)擊了確定操作了",type: 'success'
});
scope._self.$refs[`popover-${scope.$index}`].doClose()
},
到此這篇關(guān)于Element Popover 彈出框的使用示例的文章就介紹到這了,更多相關(guān)Element Popover 彈出框內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Vue項(xiàng)目配置跨域訪問和代理proxy設(shè)置方式
這篇文章主要介紹了Vue項(xiàng)目配置跨域訪問和代理proxy設(shè)置方式,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-09-09
vue如何基于el-table實(shí)現(xiàn)多頁多選及翻頁回顯過程
在最近的一個(gè)項(xiàng)目中我需要實(shí)現(xiàn)表格的翻頁,并且還要實(shí)現(xiàn)全選、多選功能,下面這篇文章主要給大家介紹了關(guān)于vue如何基于el-table實(shí)現(xiàn)多頁多選及翻頁回顯過程的相關(guān)資料,需要的朋友可以參考下2022-12-12
vue+flv.js+SpringBoot+websocket實(shí)現(xiàn)視頻監(jiān)控與回放功能
vue+springboot的項(xiàng)目,需要在頁面展示出海康的硬盤錄像機(jī)連接的攝像頭的實(shí)時(shí)監(jiān)控畫面以及回放功能,本文通過實(shí)例代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友參考下吧2022-02-02
vue?頁面卡死,點(diǎn)擊無反應(yīng)的問題及解決
這篇文章主要介紹了vue?頁面卡死,點(diǎn)擊無反應(yīng)的問題及解決方案,具有很好的參考價(jià)值,希望對大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-10-10
vue.js el-tooltip根據(jù)文字長度控制是否提示toolTip問題
這篇文章主要介紹了vue.js el-tooltip根據(jù)文字長度控制是否提示toolTip問題,具有很好的參考價(jià)值,希望對大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2024-02-02
vue.js學(xué)習(xí)之vue-cli定制腳手架詳解
這篇文章主要給大家介紹了vue.js學(xué)習(xí)之vue-cli定制腳手架的相關(guān)資料,文中介紹的非常詳細(xì),對大家具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面跟著小編一起來學(xué)習(xí)學(xué)習(xí)吧。2017-07-07

