F
F
Fktawda2020-11-18 21:01:42
Vue.js
Fktawda, 2020-11-18 21:01:42

Vue redirect not working?

These lines break the redirect and return back to the page from which the redirect went

beforeRouteEnter(to,from,next) {
    let settingsLocalStorage = localStorage.getItem('settings')
    if(settingsLocalStorage) {
      	$store.commit('budget/SET_SETTINGS', JSON.parse(settingsLocalStorage))
    } else {
      let {viewType, month, dealerShipId, year, quarter} = to.query
      let settings = $store.state.budget.settings
      $store.commit('budget/SET_SETTINGS', {
        dealerShipId: dealerShipId || settings.dealerShipId,
        viewType: viewType || settings.viewType,
        month: month || settings.month,
        quarter: quarter || settings.quarter,
        year: year || settings.year,
      })	
    }
                next()
  },

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question