vue service in the open ➡ automatically enter service ⬅ and enter 127.0.0.1 in the address bar to enter into service

Foreword

We all know that when vue project on, he will give you an address and you only have to enter its address in order to enter into the corresponding service in the server
and vue service when open does not automatically enter into service

  • Like this :
    Here Insert Picture Description
    Here Insert Picture Description

So how can we make our service to automatically open and enter 127 can enter it?

Step 1:
Create a vue.config.js file (right-click the new file) in the root directory of the project vue

Here Insert Picture Description
Step 2:
write to the file

module.exports = {
    devServer:{
        open:true,      // 自动开启
        port:80,        // 设置端口号
        host:"127.0.0.1"// 设置 host
    }
}

Step 3:
Restart your service
Here Insert Picture Description
and it will automatically open the project, and is your address 127.0.0.1
Here Insert Picture Description

Published 63 original articles · won praise 6 · views 1211

Guess you like

Origin blog.csdn.net/qq_44163269/article/details/105185656