How check if Vue is in development mode?

前端 未结 9 741
灰色年华
灰色年华 2021-01-03 18:14

When I run my Vue app, the console shows:

You are running Vue in development mode.
Make sure to turn on production mode when deploying for production.
See mo         


        
9条回答
  •  长发绾君心
    2021-01-03 19:01

    Absolutely the most simple solution is to check for the window.location from you Vue component. That would look something like this:

    if (window.location.href === 'YOUR DEVELOPMENT URL') {
        //preset form values here
    }
    

提交回复
热议问题