Element Popover 彈出框的使用示例
更新時間:2020年07月26日 11:41:24 作者:ForeverJPB.
這篇文章主要介紹了Element Popover 彈出框的使用示例,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
組件— 彈出框
基礎用法

<template>
<el-popover
placement="top-start"
title="標題"
width="200"
trigger="hover"
content="這是一段內容,這是一段內容,這是一段內容,這是一段內容。">
<el-button slot="reference">hover 激活</el-button>
</el-popover>
<el-popover
placement="bottom"
title="標題"
width="200"
trigger="click"
content="這是一段內容,這是一段內容,這是一段內容,這是一段內容。">
<el-button slot="reference">click 激活</el-button>
</el-popover>
<el-popover
ref="popover"
placement="right"
title="標題"
width="200"
trigger="focus"
content="這是一段內容,這是一段內容,這是一段內容,這是一段內容。">
</el-popover>
<el-button v-popover:popover>focus 激活</el-button>
<el-popover
placement="bottom"
title="標題"
width="200"
trigger="manual"
content="這是一段內容,這是一段內容,這是一段內容,這是一段內容。"
v-model="visible">
<el-button slot="reference" @click="visible = !visible">手動激活</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>這是一段內容這是一段內容確定刪除嗎?</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表格點擊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="請輸入內容" 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('點擊了取消操作');
scope._self.$refs[`popover-${scope.$index}`].doClose()
},
sureClick(scope){
// 可以在這里執(zhí)行刪除數據的回調操作.......刪除操作......
this.$message({
message:"點擊了確定操作了",type: 'success'
});
scope._self.$refs[`popover-${scope.$index}`].doClose()
},
到此這篇關于Element Popover 彈出框的使用示例的文章就介紹到這了,更多相關Element Popover 彈出框內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
您可能感興趣的文章:
相關文章
vue+flv.js+SpringBoot+websocket實現視頻監(jiān)控與回放功能
vue+springboot的項目,需要在頁面展示出??档挠脖P錄像機連接的攝像頭的實時監(jiān)控畫面以及回放功能,本文通過實例代碼給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友參考下吧2022-02-02
vue.js el-tooltip根據文字長度控制是否提示toolTip問題
這篇文章主要介紹了vue.js el-tooltip根據文字長度控制是否提示toolTip問題,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教2024-02-02

