|
@@ -1,84 +1,52 @@
|
|
|
-import Vue from 'vue'
|
|
|
-import UILoading from './Loading.vue'
|
|
|
-import UIShare from './Share.vue'
|
|
|
-import UITips from './Tips.vue'
|
|
|
-
|
|
|
-
|
|
|
-const Loading = Vue.extend(UILoading)
|
|
|
-const Share = Vue.extend(UIShare)
|
|
|
-const Tips = Vue.extend(UITips)
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-let loadingInstance = ''
|
|
|
-export function $showLoading(data={}) {
|
|
|
- if (loadingInstance) {
|
|
|
- return
|
|
|
- }
|
|
|
- loadingInstance = new Loading({
|
|
|
- data
|
|
|
- }).$mount()
|
|
|
-
|
|
|
- document.body.appendChild(loadingInstance.$el)
|
|
|
-
|
|
|
- Vue.nextTick(() => {
|
|
|
- loadingInstance.show = true
|
|
|
- })
|
|
|
+import Vue from "vue";
|
|
|
+import UILoading from "./Loading.vue";
|
|
|
+import UITips from "./Tips.vue";
|
|
|
+
|
|
|
+const Loading = Vue.extend(UILoading);
|
|
|
+const Tips = Vue.extend(UITips);
|
|
|
+
|
|
|
+let loadingInstance = "";
|
|
|
+export function $showLoading(data = {}) {
|
|
|
+ if (loadingInstance) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ loadingInstance = new Loading({
|
|
|
+ data,
|
|
|
+ }).$mount();
|
|
|
+
|
|
|
+ document.body.appendChild(loadingInstance.$el);
|
|
|
+
|
|
|
+ Vue.nextTick(() => {
|
|
|
+ loadingInstance.show = true;
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
export function $hideLoading() {
|
|
|
- if (loadingInstance) {
|
|
|
- document.body.removeChild(loadingInstance.$el)
|
|
|
- loadingInstance = ''
|
|
|
- }
|
|
|
+ if (loadingInstance) {
|
|
|
+ document.body.removeChild(loadingInstance.$el);
|
|
|
+ loadingInstance = "";
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+let tipsInstance = "";
|
|
|
+export function $showTips(data = {}) {
|
|
|
+ if (tipsInstance) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ tipsInstance = new Tips({
|
|
|
+ data,
|
|
|
+ }).$mount();
|
|
|
|
|
|
+ document.body.appendChild(tipsInstance.$el);
|
|
|
|
|
|
-let shareInstance = ''
|
|
|
-export function $showShare(data={}) {
|
|
|
- if (shareInstance) {
|
|
|
- return
|
|
|
- }
|
|
|
- shareInstance = new Share({
|
|
|
- data
|
|
|
- }).$mount()
|
|
|
-
|
|
|
- document.body.appendChild(shareInstance.$el)
|
|
|
-
|
|
|
- Vue.nextTick(() => {
|
|
|
- shareInstance.show = true
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-export function $hideShare() {
|
|
|
- if (shareInstance) {
|
|
|
- document.body.removeChild(shareInstance.$el)
|
|
|
- shareInstance = ''
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-let tipsInstance = ''
|
|
|
-export function $showTips(data={}) {
|
|
|
- if (tipsInstance) {
|
|
|
- return
|
|
|
- }
|
|
|
- tipsInstance = new Tips({
|
|
|
- data
|
|
|
- }).$mount()
|
|
|
-
|
|
|
- document.body.appendChild(tipsInstance.$el)
|
|
|
-
|
|
|
- Vue.nextTick(() => {
|
|
|
- tipsInstance.show = true
|
|
|
- })
|
|
|
+ Vue.nextTick(() => {
|
|
|
+ tipsInstance.show = true;
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
export function $hideTips() {
|
|
|
- if (tipsInstance) {
|
|
|
- document.body.removeChild(tipsInstance.$el)
|
|
|
- tipsInstance = ''
|
|
|
- }
|
|
|
+ if (tipsInstance) {
|
|
|
+ document.body.removeChild(tipsInstance.$el);
|
|
|
+ tipsInstance = "";
|
|
|
+ }
|
|
|
}
|