国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術(shù)文章
文章詳情頁

vue項目中使用vue-layer彈框插件的方法

瀏覽:113日期:2023-01-31 18:07:31

vue-layer彈框插件

安裝

npm i --save vue-layer

引用

import layer from ’vue-layer’Vue.prototype.$layer = layer(Vue);

參數(shù)說明

{ type: 0, //0(信息框,默認(rèn))1(頁面層)2(iframe層)3(加載層)4(tips層) title: ’信息’, content: ’’, area: ’auto’, offset: ’auto’, icon: -1, btn: ’確定’, time: 0, shade: true,//是否顯示遮罩 yes: ’’, cancel: ’’, tips: [0,{}],//支持上右下左四個方向,通過1-4進(jìn)行方向設(shè)定,可以設(shè)定tips: [1, ’#c00’] tipsMore: false,//是否允許多個tips shadeClose: true,//點(diǎn)擊遮罩是否關(guān)閉}

方法

layer.alert(content, [options, yes]); // options和yes可以省略, 如果您不愿意寫options,則可以直接寫確定按鈕的函數(shù),即yes // content 可以為htmllayer.confirm(content, [options, yes, cancel]); // options,yes和cancel可以省略, 如果您不愿意寫options,則可以直接寫確定按鈕的函數(shù),即yes,或者覆蓋默認(rèn)的cancel方法。PS:yes和cancel方法不能互換 //content 可以為htmllayer.msg(content, [options, end]); // options和end可以省略, 如果您不愿意寫options,則可以直接寫時間到期的回調(diào)即可,即end方法 // 默認(rèn)msg的關(guān)閉時間為1.5秒 // content 可以為htmllayer.tips(content, follow, options);//content 可以為html//follow對css選擇器,用來定位目標(biāo)layer.iframe({ content: { content: componentName, //傳遞的組件對象 parent: this,//當(dāng)前的vue對象 data:{}//props }, area:[’800px’,’600px’], title: ’title’});// data參數(shù)可認(rèn)為是componentName的props,同時 該方法會自動添加一個key為layerid的值, 該值為創(chuàng)建層的id, 可以直接用來關(guān)閉該層// options參數(shù)直接寫到j(luò)son里即可,比如title

layer.open(options);

layer.close(id);

layer.closeAll(type);

其它說明

該包的css都為vl-notice開頭, 需要重寫css樣式,覆蓋即可

總結(jié)

到此這篇關(guān)于vue項目中使用vue-layer彈框插件的方法的文章就介紹到這了,更多相關(guān)vue vue-layer彈框插件內(nèi)容請搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!

標(biāo)簽: Vue
相關(guān)文章:
主站蜘蛛池模板: 米脂县| 京山县| 镇宁| 正宁县| 沙河市| 宝山区| 凤冈县| 绵阳市| 宜宾市| 电白县| 勃利县| 同心县| 沂水县| 新乐市| 天长市| 黑水县| 任丘市| 梅州市| 荔波县| 玛纳斯县| 岗巴县| 长沙县| 鄄城县| 长宁县| 芮城县| 彭泽县| 肇源县| 江西省| 自治县| 金溪县| 鄂伦春自治旗| 通城县| 凤山县| 静乐县| 普安县| 黔南| 长海县| 高清| 南汇区| 辽宁省| 英超|