How to call the method defined in the methods in the vue file with the suffix js in the file with the suffix methods

{

  // 
  path:"/login",
  component: resolve => require(["@/app/Page/login/login.vue"], resolve),
  meta: {title: "",wxAuth: true},
  beforeEnter (to, from, next) {
    if (auth.loggedIn()) {
      next("/home")
    } else {
      next()
    }
  }
},
jsif(auth.loggedIn()){}vuemethods
 getLocation() {
  return this.$store.dispatch("get", {
    uri: consts.PREFIX + "/city/open/location"
  });
},
Mar.22,2021

How about

brother dei try using beforeRouteEnter in the component for a change of thinking? The purpose of looking at your code is also to initiate a get request in advance.

  document  also has instructions 

.
Menu