vue 生命周期 1,beforeCreate 組件剛剛被創建 2,created 組件創建完成 3,beforeMount 掛載之前 4,mounted 掛載之后 5,beforeDestory 組件銷毀前調用 6,destoryed 組件銷毀后調用 <template> <h3>我愛你</h3> </template> <script> export default{ data(){ return{ } }, beforeCreate(){ console.log("beforeCreate"); }, created(){ console.log('created'); }, beforeMount(){ console.log('beforeMount'); }, mounted(){ console.log('mounted'); }, beforeDestory(){ console.log('beforeDestory'); }, destoryed(){ console.log('destoryed'); } } </script> 在Vue.js的生命周期中,可以分為6個階段,也就是6個函數代表6個階段,不管順序如何變,還是會按照以下順序去執行代碼: beforeCreate(創建前)——>created(創建后)——>beforeMount(載入前)——>mounted(載入后)——>beforeDestroy(銷毀前)——>destroyed(銷毀后) 卸載命令: 卸載vue-cli : npm uninstall vue-cli -g 安裝vue-cli : npm install --global vue-cli 卸載cnpm : npm uninstall cnpm -g 安裝cnpm : npm install ---------以下是安裝vue項目完整步驟,一:----------- 安裝npm步驟:(其實直接可以使用Git軟件里面的命令控制面板安裝查看,和安裝 vue 各種執行文件) 1,Win+R 打開命令面板---輸入cmd,回車---在命令面板輸入以下命令來查看相關軟件的版本號: a, node -v + 回車 直接百度安裝node.js軟件后再到命令控制面板查看版本號 v10.16.2 b, npm -v + 回車 安裝完成node.js(npm是集成在node.js中的,如果nodejs安裝成功,則npm也安裝成功), 如果有,則會出現版本號,否則就沒有安裝。 6.9.0 c, vue + 回車(這里是直接輸入vue,沒有-V) 安裝成功后顯示如下:(通過:npm install --global vue-cli 來安裝的) $ vue Usage: vue <command> [options] Options: -V, --version output the version number <!-- 這里的V 一定是大寫,才會出現版本號 --> -h, --help output usage information Commands: init generate a new project from a template list list available official templates build prototype a new project create (for v3 warning only) help [cmd] display help for [cmd] 2,先安裝node.js 下載安裝指定盤符即可。 3,win+R 進入命令控制面板 輸入:path + 回車,安裝成功會在下方顯示node.js,可以仔細查找以下。 path 為可執行文件顯示或設置搜索路徑(在命令控制面中輸入:help,會出現一系列命令) 4,也可以直接輸入 node -v 查看是否有安裝成功,成功就會顯示版本號。 5,安裝:Git工具。 進入某個盤符,直接輸入 D: + 回車即可。 但是如果要進入:D:\前端開發\HTML\組件化網頁開發 步驟二 2-3 創建XMLHttpRequest對象\Ajax\register\img 這樣的路徑,使用手寫方式就很麻煩了,所以需要一個工具來幫忙, 這個工具就是:官網:https://git-scm.com/ 點擊 DownLoads --- 選擇相應系統的版本下載安裝即可。 安裝完成,直接打開指定的文件夾,右擊---選擇---git bash here 進入到此處的子程序 馬上就跳出一個在該路徑下面的 node.js命令面板----就可以直接進行代碼編寫。 5,安裝好node.js后,npm具體代碼安裝 ---------步驟二:(Win + R)在控制面板中輸入以下命令行----------- #全局安裝 vue-cli 分為兩種情況: 一,使用npm,訪問國外網站,我嘗試安裝好幾次都出現錯誤,所以還是建議使用淘寶鏡像。 輸入:npm install --global vue-cli (這里的npm是訪問國外的網站,下載速度很慢。所以,可以使用淘寶鏡像的cnpm) 回車等待下載完成,顯示如下: 韋德君@LAPTOP-AKTJNVLT MINGW64 /d/泉州時代/學習/vue.js $ npm install --global vue-cli npm WARN deprecated vue-cli@2.9.6: This package has been deprecated in favour of @vue/cli npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen) C:\Users\30467\AppData\Roaming\npm\vue -> C:\Users\30467\AppData\Roaming\npm\node_modules\vue-cli\bin\vue C:\Users\30467\AppData\Roaming\npm\vue-list -> C:\Users\30467\AppData\Roaming\npm\node_modules\vue-cli\bin\vue-list C:\Users\30467\AppData\Roaming\npm\vue-init -> C:\Users\30467\AppData\Roaming\npm\node_modules\vue-cli\bin\vue-init + vue-cli@2.9.6 added 241 packages from 206 contributors in 150.212s 韋德君@LAPTOP-AKTJNVLT MINGW64 /d/泉州時代/學習/vue.js 二,使用國內網站,淘寶的鏡像。 不使用上面國外的npm,改為使用使用淘寶npm鏡像的步驟: 1,輸入:npm install -g cnpm --registry=https://registry.npm.taobao.org/ + 按回車 顯示如下; 韋德君@LAPTOP-AKTJNVLT MINGW64 /d/泉州時代/學習/vue.js $ npm install -g cnpm --registry=https://registry.npm.taobao.org/ C:\Users\30467\AppData\Roaming\npm\cnpm -> C:\Users\30467\AppData\Roaming\npm\node_modules\cnpm\bin\cnpm + cnpm@6.1.0 added 680 packages from 928 contributors in 121.079s <!-- 如果是重復安裝,那么就是進行更新操作,最后一局可能會變成: updated 2 packages in 74.538s --> 2,輸入: cnpm install --global vue-cli + 回車。 顯示如下:才算成功安裝 韋德君@LAPTOP-AKTJNVLT MINGW64 /d/泉州時代/學習/vue.js cnpm install --global vue-cli Downloading vue-cli to C:\Users\30467\AppData\Roaming\npm\node_modules\vue-cli_tmp Copying C:\Users\30467\AppData\Roaming\npm\node_modules\vue-cli_tmp\_vue-cli@2.9.6@vue-cli to C:\Users\30467\AppData\Roaming\npm\node_modules\vue-cli Installing vue-cli's dependencies to C:\Users\30467\AppData\Roaming\npm\node_modules\vue-cli/node_modules [1/20] commander@^2.9.0 installed at node_modules\_commander@2.20.3@commander [2/20] ora@^1.3.0 installed at node_modules\_ora@1.4.0@ora [3/20] minimatch@^3.0.0 installed at node_modules\_minimatch@3.0.4@minimatch [4/20] multimatch@^2.1.0 installed at node_modules\_multimatch@2.1.0@multimatch [5/20] rimraf@^2.5.0 existed at node_modules\_rimraf@2.7.1@rimraf [6/20] consolidate@^0.14.0 installed at node_modules\_consolidate@0.14.5@consolidate [7/20] chalk@^2.1.0 installed at node_modules\_chalk@2.4.2@chalk [8/20] semver@^5.1.0 installed at node_modules\_semver@5.7.1@semver [9/20] tildify@^1.2.0 installed at node_modules\_tildify@1.2.0@tildify [10/20] uid@0.0.2 installed at node_modules\_uid@0.0.2@uid [11/20] user-home@^2.0.0 installed at node_modules\_user-home@2.0.0@user-home [12/20] read-metadata@^1.0.0 installed at node_modules\_read-metadata@1.0.0@read-metadata [13/20] coffee-script@1.12.7 existed at node_modules\_coffee-script@1.12.7@coffee-script [14/20] validate-npm-package-name@^3.0.0 installed at node_modules\_validate-npm-package-name@3.0.0@validate-npm-package-name [15/20] metalsmith@^2.1.0 installed at node_modules\_metalsmith@2.3.0@metalsmith [16/20] handlebars@^4.0.5 installed at node_modules\_handlebars@4.5.1@handlebars [17/20] download-git-repo@^1.0.1 installed at node_modules\_download-git-repo@1.1.0@download-git-repo [18/20] request@^2.67.0 installed at node_modules\_request@2.88.0@request [19/20] async@^2.4.0 installed at node_modules\_async@2.6.3@async [20/20] inquirer@^6.0.0 installed at node_modules\_inquirer@6.5.2@inquirer deprecate metalsmith@2.3.0 › gray-matter@2.1.1 › coffee-script@^1.12.4 CoffeeScript on NPM has moved to "coffeescript" (no hyphen) Recently updated (since 2019-11-05): 2 packages (detail see file C:\Users\30467\AppData\Roaming\npm\node_modules\vue-cli\node_modules\.recently_updates.txt) 2019-11-07 → metalsmith@2.3.0 › rimraf@2.7.1 › glob@^7.1.3(7.1.6) (06:07:44) 2019-11-06 → handlebars@4.5.1 › uglify-js@^3.1.4(3.6.8) (16:49:20) All packages installed (239 packages installed from npm registry, used 28s(network 27s), speed 191.86kB/s, json 223(438.7kB), tarball 4.55MB) [vue-cli@2.9.6] link C:\Users\30467\AppData\Roaming\npm\vue@ -> C:\Users\30467\AppData\Roaming\npm\node_modules\vue-cli\bin\vue [vue-cli@2.9.6] link C:\Users\30467\AppData\Roaming\npm\vue-init@ -> C:\Users\30467\AppData\Roaming\npm\node_modules\vue-cli\bin\vue-init [vue-cli@2.9.6] link C:\Users\30467\AppData\Roaming\npm\vue-list@ -> C:\Users\30467\AppData\Roaming\npm\node_modules\vue-cli\bin\vue-list <!-- 安裝成功,上面是最后一句代碼 --> ----------步驟三:使用git打開指定目錄,創建webpack模板的新項目---------- 如果這里不適用Git工具,那么就必須在命令控制面板中找到指定目錄下再執行以下命令 如果node.js 和 npm/cnpm 已經安裝完畢, 需要創建新的項目,則直接執行后面的幾個步驟即可。有時候會運行失敗,不知道是什么情況。 此外,不能在已經創建好的項目中創建另外一個項目,否則直接報錯。 ------------------------------------------------- <!-- 下面的:這里必須注意, ? Install vue-router? (Y/n) Y 一定要輸入Y,即YES --> #創建一個基於webpack模板的新項目 輸入:vue init webpack my-project 顯示如下: 韋德君@LAPTOP-AKTJNVLT MINGW64 /d/泉州時代/學習/vue.js $ vue init webpack my-project ? Project name (my-project) <!-- 是否把項目命名為(my-project) 直接回車即可(默認肯定) --> ? Project name my-project ? Project description (A Vue.js project) <!-- 是否進行項目描述 直接回車即可(默認肯定) --> ? Project description A Vue.js project ? Author <!-- 是否填寫作者 直接回車即可(默認肯定) --> ? Author ? Vue build standalone <!-- 是否獨立創建Vue 直接回車即可(默認肯定) --> ? Install vue-router? (Y/n) Y <!-- 這里必須注意,一定要輸入Y,即YES --> ? Install vue-router? Yes ? Use ESLint to lint your code? (Y/n) n ? Use ESLint to lint your code? No ? Set up unit tests (Y/n) n ? Set up unit tests No ? Setup e2e tests with Nightwatch? (Y/n) n ? Setup e2e tests with Nightwatch? No ? Should we run `npm install` for you after the project has been created? (recom ? Should we run `npm install` for you after the project has been created? (recom mended) npm vue-cli · Generated "my-project". # Installing project dependencies ... # ======================== npm WARN deprecated extract-text-webpack-plugin@3.0.2: Deprecated. Please use https://github.com/webpack-contrib/mini-css-extract-plugin npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools. npm WARN deprecated bfj-node4@5.3.1: Switch to the `bfj` package for fixes and new features! <!-- 安裝成功上面是最后一句代碼 --> <!-- 安裝成功以下是警告,可能有可能沒有: --> npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3. npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools. 這樣項目模板就算創建完畢了 ,ctrl + C 退出命令控制面板。 按完 Ctrl + C 就會跳轉到如下: 韋德君@LAPTOP-AKTJNVLT MINGW64 /d/泉州時代/學習/vue.js $ 注意點: vue init webpack my-projectSecond 項目名稱不能有大寫字母,否則直接報錯,如下: ? Project name (my-projectSecond) my-projectSecond >> Sorry, name can no longer contain capital letters. ----------步驟四:輸入下面的幾句代碼---------- #安裝依賴包 1,輸入:cd my-project + 回車 沒有其他顯示,只是換行繼續輸入下面一句代碼。 2,輸入:cnpm install + 回車 (淘寶鏡像使用) / npm install (下載國外的npm才使用) 顯示如下: 韋德君@LAPTOP-AKTJNVLT MINGW64 /d/泉州時代/學習/vue.js/my-project $ cnpm install platform unsupported babel-loader@7.1.5 › webpack@3.12.0 › watchpack@1.6.0 › chokidar@2.1.8 › fsevents@^1.2.7 Package require os(darwin) not compatible with your platform(win32) [fsevents@^1.2.7] optional install error: Package require os(darwin) not compatible with your platform(win32) √ Installed 37 packages √ Linked 744 latest versions [1/2] scripts.postinstall babel-loader@7.1.5 › webpack@3.12.0 › uglifyjs-webpack-plugin@^0.4.6 run "node lib/post_install.js", root: "D:\\泉州時代\\學習\\vue.js\\my-project\\node_modules\\_uglifyjs-webpack-plugin@0.4.6@uglifyjs-webpack-plugin" [1/2] scripts.postinstall babel-loader@7.1.5 › webpack@3.12.0 › uglifyjs-webpack-plugin@^0.4.6 finished in 671ms [2/2] scripts.postinstall babel-core@6.26.3 › babel-register@6.26.0 › core-js@^2.5.0 run "node postinstall || echo \"ignore\"", root: "D:\\泉州時代\\學習\\vue.js\\my-project\\node_modules\\_core-js@2.6.10@core-js" Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library! The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: > https://opencollective.com/core-js > https://www.patreon.com/zloirock Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -) [2/2] scripts.postinstall babel-core@6.26.3 › babel-register@6.26.0 › core-js@^2.5.0 finished in 751ms √ Run 2 scripts deprecate autoprefixer@7.2.6 › browserslist@^2.11.3 Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools. deprecate extract-text-webpack-plugin@^3.0.0 Deprecated. Please use https://github.com/webpack-contrib/mini-css-extract-plugin deprecate css-loader@0.28.11 › cssnano@3.10.0 › autoprefixer@6.7.7 › browserslist@^1.7.6 Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools. deprecate babel-loader@7.1.5 › webpack@3.12.0 › watchpack@1.6.0 › chokidar@2.1.8 › fsevents@^1.2.7 One of your dependencies needs to upgrade to fsevents v2: 1) Proper nodejs v10+ support 2) No more fetching binaries from AWS, smaller package size deprecate webpack-bundle-analyzer@2.13.1 › bfj-node4@^5.2.0 Switch to the `bfj` package for fixes and new features! Recently updated (since 2019-11-05): 12 packages (detail see file <!-- 安裝成功表現一:一定會標注最近一次更新的時間是:(since 2019-11-05) --> D:\泉州時代\學習\vue.js\my-project\node_modules\.recently_updates.txt) √ All packages installed (920 packages installed from npm registry, used 1m(network 1m), speed 253.07kB/s, json 781(1.73MB), tarball 18.3MB) <!-- 安裝成功表現二:上面是最后一句代碼,一定是: √ All... --> 韋德君@LAPTOP-AKTJNVLT MINGW64 /d/泉州時代/學習/vue.js/my-project 3,輸入:npm run dev + 回車 (讓項目跑起來,淘寶鏡像和國外npm都可以使用,因為沒有涉及下載) 顯示如下: 韋德君@LAPTOP-AKTJNVLT MINGW64 /d/泉州時代/學習/vue.js/my-project $ npm run dev (不管是淘寶鏡像的 cnpm 還是直接使用 npm,啟動都是用:npm run dev) > my-project@1.0.0 dev D:\泉州時代\學習\vue.js\my-project > webpack-dev-server --inline --progress --config build/webpack.dev.conf.js D:\Ȫ▒▒ʱ▒▒\ѧϰ\vue.js\my-project>"node" "D:\Ȫ▒▒ʱ▒▒\ѧϰ\vue.js\my-project\node_modules\.bin\\..\_webpack-dev-server@2.11.5@webpack-dev-server\bin\webpack-dev-server.js" --inline --progress --config build/webpack.dev.conf.js 10% building modules 0/1 modules 1 active ... webpack/hot/dev-server ./src/main 10% building modules 1/2 modules 1 active ...泉州時代\學習\vue.js\my-project\sr 10% building modules 2/3 modules 1 active ...client\index.js?http://localhost:8 10% building modules 3/4 modules 1 active ...\webpack\hot nonrecursive /^\.\/lo 10% building modules 3/5 modules 2 active ...5@webpack-dev-server\client\socket 10% building modules 3/6 modules 3 active ...@webpack-dev-server\client\overlay 10% building modules 3/7 modules 4 active ...pack@3.12.0@webpack\hot\dev-server 10% building modules 4/7 modules 3 active ...pack@3.12.0@webpack\hot\dev-server 10% building modules 4/8 modules 4 active ...vue.js\my-project\src\router\index 10% building modules 5/8 modules 3 active ...vue.js\my-project\src\router\index 10% building modules 6/8 modules 2 active ...vue.js\my-project\src\router\index 10% building modules 7/8 modules 1 active ...vue.js\my-project\src\router\index 10% building modules 7/9 modules 2 active ...webpack@3.12.0@webpack\hot\emitter 10% building modules 7/10 modules 3 active ...dules\_vue@2.6.10@vue\dist\vue.es 10% building modules 7/11 modules 4 active ...t\node_modules\_url@0.11.0@url\ur 10% building modules 8/11 modules 3 active ...t\node_modules\_url@0.11.0@url\ur 11% building modules 9/11 modules 2 active ...t\node_modules\_url@0.11.0@url\ur 11% building modules 9/12 modules 3 active ...es\_webpack@3.12.0@webpack\hot\lo 11% building modules 9/13 modules 4 active ....12.0@webpack\hot\log-apply-resul 11% building modules 10/13 modules 3 active ....12.0@webpack\hot\log-apply-resu 11% building modules 11/13 modules 2 active ...t\node_modules\_url@0.11.0@url\u 11% building modules 11/14 modules 3 active ...泉州時代\學習\vue.js\my-project\ 11% building modules 11/15 modules 4 active ...project\src\components\HelloWorl 11% building modules 11/16 modules 5 active ...glevel@1.6.6@loglevel\lib\loglev 11% building modules 12/16 modules 4 active ...glevel@1.6.6@loglevel\lib\loglev 11% building modules 13/16 modules 3 active ...glevel@1.6.6@loglevel\lib\loglev 11% building modules 13/17 modules 4 active ...odules\_events@3.0.0@events\even 11% building modules 14/17 modules 3 active ...odules\_events@3.0.0@events\even 11% building modules 14/18 modules 4 active ..._strip-ansi@3.0.1@strip-ansi\ind 11% building modules 14/19 modules 5 active ...nt@1.1.5@sockjs-client\dist\sock 11% building modules 15/19 modules 4 active ...nt@1.1.5@sockjs-client\dist\sock 11% building modules 15/20 modules 5 active ...\node_modules\_url@0.11.0@url\ut 11% building modules 15/21 modules 6 active ...s\_ansi-html@0.0.7@ansi-html\ind 11% building modules 15/22 modules 7 active ...ng-es3@0.2.1@querystring-es3\ind 11% building modules 15/23 modules 8 active ...\_punycode@1.4.1@punycode\punyco 11% building modules 15/24 modules 9 active ...泉州時代\學習\vue.js\my-project\ 11% building modules 15/25 modules 10 active ...project\src\components\HelloWor 11% building modules 16/25 modules 9 active ...project\src\components\HelloWorl 12% building modules 17/25 modules 8 active ...\_punycode@1.4.1@punycode\punyco 12% building modules 17/26 modules 9 active ...ue-loader\lib\component-normaliz 12% building modules 18/26 modules 8 active ...ue-loader\lib\component-normaliz 12% building modules 18/27 modules 9 active ...泉州時代\學習\vue.js\my-project\ 12% building modules 18/28 modules 10 active ...project\src\components\HelloWorld.vue{ parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }. 12% building modules 19/28 modules 9 active ...project\src\components\HelloWorl 12% building modules 20/28 modules 8 active ...ue-loader\lib\component-normaliz 12% building modules 21/28 modules 7 active ...ue-loader\lib\component-normaliz 12% building modules 22/28 modules 6 active ...ue-loader\lib\component-normaliz 12% building modules 22/29 modules 7 active ...entities@1.2.1@html-entities\ind 12% building modules 23/29 modules 6 active ...entities@1.2.1@html-entities\ind 12% building modules 24/29 modules 5 active ...entities@1.2.1@html-entities\ind 13% building modules 25/29 modules 4 active ...entities@1.2.1@html-entities\ind 13% building modules 25/30 modules 5 active ...1.3@vue-router\dist\vue-router.e 13% building modules 26/30 modules 4 active ...1.3@vue-router\dist\vue-router.e 13% building modules 27/30 modules 3 active ...1.3@vue-router\dist\vue-router.e 13% building modules 27/31 modules 4 active ...g-es3@0.2.1@querystring-es3\deco 13% building modules 27/32 modules 5 active ...g-es3@0.2.1@querystring-es3\enco 13% building modules 27/33 modules 6 active ...2.1@html-entities\lib\xml-entiti 13% building modules 27/34 modules 7 active ...1@html-entities\lib\html4-entiti 13% building modules 27/35 modules 8 active ...1@html-entities\lib\html5-entiti 13% building modules 27/36 modules 9 active ...pack@3.12.0@webpack\buildin\modu 13% building modules 27/37 modules 10 active ...pack@3.12.0@webpack\buildin\glo 13% building modules 28/37 modules 9 active ...pack@3.12.0@webpack\buildin\glob 13% building modules 29/37 modules 8 active ...pack@3.12.0@webpack\buildin\glob 13% building modules 30/37 modules 7 active ...pack@3.12.0@webpack\buildin\glob 13% building modules 31/37 modules 6 active ...pack@3.12.0@webpack\buildin\glob 13% building modules 32/37 modules 5 active ...1@html-entities\lib\html5-entiti 13% building modules 32/38 modules 6 active ....3.4@vue-hot-reload-api\dist\ind 13% building modules 32/39 modules 7 active ...泉州時代\學習\vue.js\my-project\ 13% building modules 33/39 modules 6 active ....3.4@vue-hot-reload-api\dist\ind 13% building modules 33/40 modules 7 active ...project\src\components\HelloWorl 14% building modules 34/40 modules 6 active ....3.4@vue-hot-reload-api\dist\ind 14% building modules 35/40 modules 5 active ....3.4@vue-hot-reload-api\dist\ind 14% building modules 35/41 modules 6 active ...泉州時代\學習\vue.js\my-project\ 14% building modules 35/42 modules 7 active ...project\src\components\HelloWorl 14% building modules 36/42 modules 6 active ...project\src\components\HelloWorl 14% building modules 37/42 modules 5 active ...project\src\components\HelloWorl 14% building modules 37/43 modules 6 active ...e-style-loader\lib\addStylesClie 14% building modules 38/43 modules 5 active ...e-style-loader\lib\addStylesClie 14% building modules 39/43 modules 4 active ...e-style-loader\lib\addStylesClie 14% building modules 39/44 modules 5 active ...vue.js\my-project\src\assets\log 14% building modules 40/44 modules 4 active ...vue.js\my-project\src\assets\log 14% building modules 40/45 modules 5 active ..._ansi-regex@2.1.1@ansi-regex\ind 14% building modules 41/45 modules 4 active ..._ansi-regex@2.1.1@ansi-regex\ind 15% building modules 42/45 modules 3 active ..._ansi-regex@2.1.1@ansi-regex\ind 15% building modules 42/46 modules 4 active ...@vue-style-loader\lib\listToStyl 15% building modules 43/46 modules 3 active ...@vue-style-loader\lib\listToStyl 15% building modules 44/46 modules 2 active ...@vue-style-loader\lib\listToStyl 15% building modules 45/46 modules 1 active ...@vue-style-loader\lib\listToStyl 15% building modules 46/47 modules 1 active ...er@0.28.11@css-loader\lib\css-ba 95% emitting DONE Compiled successfully in 14781ms4:18:45 PM I Your application is running here: http://localhost:8080 韋德君@LAPTOP-AKTJNVLT MINGW64 /d/泉州時代/學習/vue.js/my-project 最后可以在網頁地址欄輸入:http://localhost:8080 進行訪問。 注意,該命令控制面板是不能關閉的,否則就無法正常打開頁面。 如果不小心關閉了,則使用Git在創建項目的文件夾中右擊:Git Bash Here 進入該子程序。 然后再執行:npm run dev + 回車 等待運行完成。 ======================================= 打開頁面一定要有兩個特點: 1,一定有路由 router(路由是需要配置的) 英 /'ruːtə(r)/路由器,路由 2,一定有一個頁面(該頁面是 .vue 格式的)
=======================================