1、安装 live-server,然后调用该包,建立起一个服务,即http://127.0.0.1:8080/example/,自动在浏览器中打开创建的页面
npm install -g live-server

Windows PowerShell
版权所有 (C) Microsoft Corporation。保留所有权利。

PS F:\File_HTML\Vue> npm install -g live-server
C:\Users\99386\AppData\Roaming\npm\live-server -> C:\Users\99386\AppData\Roaming\npm\node_modules\live-server\live-server.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\live-server\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ live-server@1.2.0
added 123 packages from 83 contributors in 59.527s
PS F:\File_HTML\Vue>

Logo

前往低代码交流专区

更多推荐