You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
663 B
37 lines
663 B
|
3 years ago
|
/*
|
||
|
|
* @Description: 全局mixin
|
||
|
|
* @Author: 无痕
|
||
|
|
* @Email: 350801869@qq.com
|
||
|
|
* @Date: 2021-02-23 14:35:39
|
||
|
|
* @LastEditTime: 2021-04-14 15:06:03
|
||
|
|
* @LastEditors: 无痕
|
||
|
|
*/
|
||
|
|
import Toast from '../utils/toast';
|
||
|
|
import Dialog from '../utils/dialog';
|
||
|
|
|
||
|
|
const state = {
|
||
|
|
currentPagePath: '',
|
||
|
|
};
|
||
|
|
|
||
|
|
const gobalMixin = {
|
||
|
|
data() {
|
||
|
|
return {
|
||
|
|
S_MIXIN_STATE: state,
|
||
|
|
};
|
||
|
|
},
|
||
|
|
computed: {
|
||
|
|
$sIsCurrentPage() {
|
||
|
|
return state.currentPagePath === this.$root?.$mp?.page?.route;
|
||
|
|
},
|
||
|
|
},
|
||
|
|
onShow() {
|
||
|
|
state.currentPagePath = this.$root?.$mp?.page?.route;
|
||
|
|
},
|
||
|
|
onUnload() {
|
||
|
|
Toast.clear();
|
||
|
|
Dialog.clear();
|
||
|
|
},
|
||
|
|
};
|
||
|
|
|
||
|
|
export default gobalMixin;
|