我在docker中使用vue-cli,并且必须将服务绑定到LAN IP,或者0.0.0.0为了"本地"访问它们.
我期待--host 0.0.0.0,但那不存在.
$ vue ui
Starting GUI...
Ready on http://localhost:8000
$ vue ui -h
Usage: ui [options]
start and open the vue-cli ui
Options:
-p, --port <port> Port used for the UI server (by default search for awailable port)
-D, --dev Run in dev mode
--quiet Don't output starting messages
--headless Don't open browser on start and output port
-h, --help output usage information
似乎在vue-cli版本3.1.0中添加了-H / --host选项:https : //github.com/vuejs/vue-cli/pull/2568
$ vue --version
3.1.3
$ vue ui -h
Usage: ui [options]
start and open the vue-cli ui
Options:
-H, --host <host> Host used for the UI server (default: localhost)
-p, --port <port> Port used for the UI server (by default search for available port)
-D, --dev Run in dev mode
--quiet Don't output starting messages
--headless Don't open browser on start and output port
-h, --help output usage information
$ vue ui -H 0.0.0.0
Starting GUI...
Ready on http://0.0.0.0:8000
Run Code Online (Sandbox Code Playgroud)
这解决了我的问题。
| 归档时间: |
|
| 查看次数: |
1227 次 |
| 最近记录: |