小編給大家分享一下vue插件--仿微信小程序showModel模態(tài)提示窗功能的方法,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!

效果圖:

下面是源碼:
index.js
import Vue from 'vue';
import model from './model.vue';
export default {
install(Vue) {
const defaults = {
show: false,
mask: true,
title: '提示',
content: '這是正文',
confirmButton: true,
cancelButton: true,
confirmText: '確認(rèn)',
cancelText: '取消',
cancelCallBack: () => {},
confirmCallBack: () => {}
};
const modelVueConstructor = Vue.extend(model);
Vue.prototype.$model = (options = {}) => {
if (Vue.prototype.$isServer) return;
options = Object.assign({}, defaults, options);
let parent = document.body ;
let instance = new modelVueConstructor({
el: document.createElement('div'),
data: options
});
parent.appendChild(instance.$el);
return instance;
};
},
};
本文標(biāo)題:vue插件--仿微信小程序showModel模態(tài)提示窗功能的方法-創(chuàng)新互聯(lián)
URL網(wǎng)址:http://chinadenli.net/article0/edpoo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供標(biāo)簽優(yōu)化、外貿(mào)建站、ChatGPT、品牌網(wǎng)站制作、商城網(wǎng)站、微信小程序
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容