Nuxt使用记录

代码及插件需要根据环境引入

(服务端没有window,document,浏览器端没有global)

const myPlugins = {
  install(Vue, options) {
    Vue.prototype.$scroll = {
      set: () => {},
      clear: () => {},
    };
    if (!process.browser)
      return;
    Vue.prototype.$scroll = scroll;
  },
};

Vue.use(myPlugins);

  

 

 

不能watch $route change
route变化时页面数据相当于刷新

 

posted @ 2017-11-29 17:29  _NKi  阅读(275)  评论(0)    收藏  举报