plugin.js 400 Bytes
export default (store) => {
  if (process.env.VUE_ENV !== 'server') {
    window.onresize = () => {
      const {clientWidth, clientHeight} = document.body;

      store.commit('SET_WINDOW_SIZE', {clientWidth, clientHeight});
    };
    setTimeout(() => {
      const {clientWidth, clientHeight} = document.body;

      store.commit('SET_WINDOW_SIZE', {clientWidth, clientHeight});
    }, 0);
  }
};