Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { Component, Emit, Inject, Model, Prop, Provide, Vue, Watch } from 'vue-property-decorator';
import { VueConstructor } from "vue";
import store from '@/store/index'
let isApp = false; //尝试mpvue-entry
let MyApp;
/* app-only-begin */
isApp = true;
interface IMpVue extends VueConstructor {
mpType: string
}
Vue.prototype.$store = store;
// 添加小程序hooks http://mpvue.com/mpvue/#_4
Component.registerHooks([
// app
'onLaunch', // 初始化
'onShow', // 当小程序启动,或从后台进入前台显示
'onHide', // 当小程序从前台进入后台,子组件也会调用这个函数
// pages
'onLoad', // 监听页面加载
'onShow', // 监听页面显示
'onReady', // 监听页面初次渲染完成
'onHide', // 监听页面隐藏
'onUnload', // 监听页面卸载 后退的时候执行,组件卸载
'onPullDownRefresh', // 监听用户下拉动作
'onReachBottom', // 页面上拉触底事件的处理函数
'onShareAppMessage', // 用户点击右上角分享
return Object.keys(MonthsNames).map((key: string) => {
return Vue.prototype.$i18n.translate(
`${TRANSLATION_MONTHS}.${MonthsNames[key]}`
);
});
}
private goToHomePage () {
Vue.prototype.$navigateTo(Home);
}
return Object.keys(WeekdayNames).map((key: string) => {
return Vue.prototype.$i18n.translate(
`${TRANSLATION_WEEKDAYS}.${WeekdayNames[key]}${TRANSLATION_SUFFIXE}`
);
});
}
private goToAboutPage () {
Vue.prototype.$navigateTo(About);
}
}
return Object.keys(MonthsNames).map((key: string) => {
return Vue.prototype.$i18n.translate(
`${TRANSLATION_MONTHS}.${MonthsNames[key]}${TRANSLATION_SUFFIXE}`
);
});
}
return Object.keys(MonthsNames).map((key: string) => {
return Vue.prototype.$i18n.translate(
`${TRANSLATION_MONTHS}.${MonthsNames[key]}${TRANSLATION_SUFFIXE}`
);
});
}
private goToAboutPage () {
Vue.prototype.$navigateTo(About);
}
}