Clean up code
This commit is contained in:
parent
32e3c6067b
commit
6082d37177
|
|
@ -7,11 +7,7 @@ class ModalStore {
|
||||||
this.vm = new Vue({
|
this.vm = new Vue({
|
||||||
data: () => ({
|
data: () => ({
|
||||||
component: '',
|
component: '',
|
||||||
payload: {},
|
payload: {}
|
||||||
_resolve: () => {
|
|
||||||
},
|
|
||||||
_reject: () => {
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -19,25 +15,15 @@ class ModalStore {
|
||||||
get state() {
|
get state() {
|
||||||
return this.vm.$data;
|
return this.vm.$data;
|
||||||
}
|
}
|
||||||
|
|
||||||
// set component(c) {
|
|
||||||
// console.log(c);
|
|
||||||
// this.vm.$data.component = c;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const ModalPlugin = {
|
const ModalPlugin = {
|
||||||
// Store: ModalStore,
|
|
||||||
install(Vue, options) {
|
install(Vue, options) {
|
||||||
const store = new ModalStore({});
|
const store = new ModalStore({});
|
||||||
|
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
store.state.component = '';
|
store.state.component = '';
|
||||||
store.state.payload = {};
|
store.state.payload = {};
|
||||||
store.state._resolve = () => {
|
|
||||||
};
|
|
||||||
store.state._reject = () => {
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Vue.prototype.$modal = {
|
Vue.prototype.$modal = {
|
||||||
|
|
@ -64,7 +50,6 @@ const ModalPlugin = {
|
||||||
},
|
},
|
||||||
_reject: () => {
|
_reject: () => {
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue