vue 移动端加载、提示框

版权声明:本文为博主原创文章,未经博主允许不得转载。https://www.cnblogs.com/suisuisui/p/9771665.html

用的是vue2.0+/vuex

首先 在项目中npm install vux 下载vux 

//全局注册 在入口文件全局引入main.js

import Vue from 'vue'
import { Loading,Toast,} from 'vux' Vue.component('loading', Loading)
Vue.component('toast', Toast)
 
 

加载

this.$vux.loading.show({

     text: "加载中"

    });

this.$vux.loading.hide();

错误提示

this.$vux.toast.show({

type: "warn",

text: result.AllMessages,

width:'6em'

});

文本提示

that.$vux.toast.show({

text: "文本",

type: "text"

});

需要其他插件直接参考文档(vux官网地址:https://doc.vux.li/zh-CN/components/actionsheet.html)

猜你喜欢

转载自www.cnblogs.com/suisuisui/p/9771665.html