1. 程式人生 > >vue 移動端加載、提示框

vue 移動端加載、提示框

錯誤 this 移動端 spa install ins div load html

版權聲明:本文為博主原創文章,未經博主允許不得轉載。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)

vue 移動端加載、提示框