uni-events-helper-wx
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.

26 lines
707 B

3 years ago
  1. import store from '@/nxTemp/store';
  2. import wechat from '@/nxTemp/wechat/wechat';
  3. import tools from '@/nxTemp/utils/tools'
  4. import * as filter from '@/nxTemp/filter';
  5. const install = Vue => {
  6. // global filter
  7. Object.keys(filter).forEach(item => {
  8. Vue.filter(item, filter[item]);
  9. });
  10. // 挂载函数
  11. Vue.prototype.$store = store;
  12. Vue.prototype.$tools = tools;
  13. // event Bus 用于无关系组件间的通信。
  14. Vue.prototype.$bus = new Vue()
  15. }
  16. export async function init(options) {
  17. // #ifdef MP-WEIXIN
  18. // 检测小程序更新(如果从朋友圈场景进入则无此API)
  19. options.scene !== 1154 && wechat.checkMiniProgramUpdate();
  20. // #endif
  21. }
  22. export default {
  23. install
  24. }