zoukankan      html  css  js  c++  java
  • vue

    1.app
    // 将wx挂载到vue实例上
    Vue.prototype.$wx = wx
    // axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'
    // axios.defaults.headers.post['Content-Type'] = 'application/json'
     
    Vue.prototype.$http = axios
    router.beforeEach((to, from, next) => {
    /* 路由发生变化修改页面meta */
    if(to.meta.content){
    let head = document.getElementsByTagName('head');
    let meta = document.createElement('meta');
    meta.content = to.meta.content;
    head[0].appendChild(meta)
    }
    /* 路由发生变化修改页面title */
    if (to.meta.title) {
    document.title = to.meta.title;
    }
    // 处理jssdk签名,兼容history模式
    if (!store.state.url) {
    store.commit('setUrl', document.URL)
    }
    next()
    });
     
     
    let dateServer = value => {
      return value.replace(/(d{4})(d{2})(d{2})/g, '$1-$2-$3')
    }
    export { dateServer }

    /src/main.js

    import * as custom from './common/filters/custom'
    
    Object.keys(custom).forEach(key => {
      Vue.filter(key, custom[key])
    })
  • 相关阅读:
    ssd的BUG
    ImportError: No module named lmdb
    GPU卡掉卡
    mobileeye
    caffe convert mxnet
    学前书单-百科
    捉襟见肘
    caffe+opencv3.3.1
    ipython notebook开通远程
    到底什么是故事点(Story Point)?
  • 原文地址:https://www.cnblogs.com/guidan/p/10267559.html
Copyright © 2011-2022 走看看