search

Home  >  Q&A  >  body text

How to access VUE instance in vue-router?

As shown in the picture, vue-router is used in the project and placed under the path in the picture

/router/index.js introduces Vue and vue-router

import Vue from 'vue'
import Router from 'vue-router'

There is a Vue.prototype.debug = true defined in main.js

Now I want to know how to access the Vue.prototype.debug object in /router/index.js?

淡淡烟草味淡淡烟草味2744 days ago1098

reply all(1)I'll reply

  • 黄舟

    黄舟2017-05-19 10:26:34

    I don’t know how to deal with your problem.
    My way to save the country is: define a config.js, declare it in itexport const APP_DEBUG_MODE = true, and then introduce this config to determine the value of APP_DEBUG_MODE where you need to judge Vue.debug

    reply
    0
  • Cancelreply