Element Popover 彈出框的使用示例
組件— 彈出框
基礎(chǔ)用法
<template> <el-popover placement="top-start" title="標題" 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="標題" 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="標題" 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="標題" width="200" trigger="manual" content="這是一段內(nèi)容,這是一段內(nèi)容,這是一段內(nèi)容,這是一段內(nèi)容。" 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>這是一段內(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表格點擊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('點擊了取消操作'); scope._self.$refs[`popover-${scope.$index}`].doClose() }, sureClick(scope){ // 可以在這里執(zhí)行刪除數(shù)據(jù)的回調(diào)操作.......刪除操作...... this.$message({ message:"點擊了確定操作了",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.js學(xué)習(xí)筆記:如何加載本地json文件
這篇文章主要介紹了vue.js學(xué)習(xí)筆記:如何加載本地json文件,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧。2017-01-01vue 使用插槽分發(fā)內(nèi)容操作示例【單個插槽、具名插槽、作用域插槽】
這篇文章主要介紹了vue 使用插槽分發(fā)內(nèi)容操作,結(jié)合實例形式總結(jié)分析了vue.js使用單個插槽、具名插槽、作用域插槽相關(guān)操作技巧與注意事項,需要的朋友可以參考下2020-03-03vue.js添加一些觸摸事件以及安裝fastclick的實例
今天小編就為大家分享一篇vue.js添加一些觸摸事件以及安裝fastclick的實例,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2018-08-08Vue整合Node.js直連Mysql數(shù)據(jù)庫進行CURD操作過程詳解
這篇文章主要給大家分享Vue整合Node.js,直連Mysql數(shù)據(jù)庫進行CURD操作的詳細過程,文中有詳細的代碼講解,具有一定的參考價值,需要的朋友可以參考下2023-07-07Vue-Router實現(xiàn)組件間跳轉(zhuǎn)的三種方法
這篇文章主要為大家詳細介紹了Vue-Router來實現(xiàn)組件間跳轉(zhuǎn)的三種方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-11-11vue中el-cascader三級聯(lián)動懶加載回顯問題解決
本文主要介紹了vue中el-cascader三級聯(lián)動懶加載回顯問題解決,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2023-06-06vue在自定義組件中使用v-model進行數(shù)據(jù)綁定的方法
這篇文章主要介紹了vue在自定義組件中使用v-model進行數(shù)據(jù)綁定的方法,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-03-03Vue簡單封裝axios之解決post請求后端接收不到參數(shù)問題
這篇文章主要介紹了Vue簡單封裝axios之解決post請求后端接收不到參數(shù)問題,本文通過實例代碼給大家介紹的非常詳細,具有一定的參考借鑒價值,需要的朋友可以參考下2020-02-02