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 格式的) =======================================
安装node.js 和 npm 的完整步骤的更多相关文章
-
Windwos安装Node.js和npm的详细步骤
How to Install Node.js and NPM on Windows Node.js和npm 安装 Node.js 的时候会自动安装 npm ,并且 npm 就是 Node.js 的包管 ...
-
如何在CentOS 7上安装Node.js和npm
Node.js是一个跨平台的JavaScript运行时环境,允许在服务器端执行JavaScript代码.Node.js主要用于后端,但也作为全栈和前端解决方案而流行. npm,Node软件包管理器的缩 ...
-
安装node.js后npm不可用
安装node.js后npm不可用 最近要用Vue做项目,依赖node.js,于是按官网下载安装node 下载地址:https://nodejs.org/en/download/ 网上也有很多教程这里就 ...
-
laravel项目中通过nvmw安装node.js和npm 开发环境-- windows版
windows版本安装 此教程执行的时候,网速一定要好.不然可能出现各种错误. 如果本文对你有用,请爱心点个赞,提高排名,帮助更多的人.谢谢大家!❤ git clone nvmw 直接从 githu ...
-
ubuntu16.04安装node.js、npm
ubuntu16.04安装node.js.npm1.请尽量避免在 Ubuntu 上使用 apt-get 来安装 node.js, 如果你已经这么做了,请手动移除: sudo apt-get purge ...
-
(转)在Windows平台上安装Node.js及NPM模块管理
本文转载自:http://www.cnblogs.com/seanlv/archive/2011/11/22/2258716.html 之前9月份的时候我写了一篇关于如何在Windows平台上手工管理 ...
-
Win10环境安装node.js和npm
Node.js和npm的关系 Node.js是一个基于Chrome V8引擎的JavaScript运行环境,使用了事件驱动非阻塞式I/O模型. npm(Node Package Manager)是一个 ...
-
在Linux Mint上安装node.js和npm
1.安装Node.js 前端开发过程中,很多项目使用npm的http-server的模块来运行一个静态的服务器,我个人在Dell的笔记本上安装的是Linux Mint最新版本,所以想尝试一下在Linu ...
-
Mac中安装node.js和npm
换了Mac需要安装noed.js和npm记录一下首先访问node.js官网(https://nodejs.org/en/download/) 点击下载完后,一路点安装 就安装完成了 然后打开-终端-输 ...
随机推荐
-
Libcurl多线程crash问题(cento)
cento :http://blog.csdn.net/delphiwcdj/article/details/18284429 1 问题背景 后台系统有一个单线程的http接口,为了提高并发处理能力, ...
-
easyui layout 折叠后显示标题
(function($){ var buttonDir = {north:'down',south:'up',east:'left',west:'right'}; $.extend($.fn.layo ...
-
初探groupcache
groupcache是用于dl.google.com的一个memcached的替代品,相对于memcached,提供更小的功能集和更高的效率,以第三方库的形式提供服务. groupcache的常见部署 ...
-
论文阅读之:Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network
Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network 2016.10.23 摘要: ...
-
使用引脚模拟PWM波控制引脚
/********************************* 代码功能:输出PWM波控制引脚 使用函数: 创作时间:2016*10*07 作者邮箱:jikexianfeng@outlook.c ...
-
UITableView详解(转)
首先.对UITableView进行讲解,下面有对它进行实际的应用 UITableView 显示大型内容的列表 单行,多列 垂直滚动,没有水平滚动 大量的数据集 性能强大,而且普遍存在于iPhone的应 ...
-
ACE 6.2.0 RHEL6_Linux 编译
第一步. 设置环境变量 export ACE_ROOT=$HOME/ace/ACE_wrappersexport LD_LIBRARY_PATH=$ACE_ROOT/ace:$ACE_ROOT/lib ...
-
Java进阶(三十九)Java集合类的排序,查找,替换操作
Java进阶(三十九)Java集合类的排序,查找,替换操作 前言 在Java方向校招过程中,经常会遇到将输入转换为数组的情况,而我们通常使用ArrayList来表示动态数组.获取到ArrayList对 ...
-
Activity简单几步支持向右滑动返回
向右滑动返回,对于屏幕过大的手机来说,在单手操作时,是一个不错的用户体验,用户不必再费力的或者用另一个手去点击屏幕左上角的返回按钮或者,手机右下角的返回按钮,轻轻向右滑动屏幕即可返回上一页,这个功能如 ...
-
jQuery使用(四):DOM操作之查找兄弟元素和父级元素
查找兄弟元素 向下查找兄弟元素 next() nextAll() nextUntil() 向上查找兄弟元素 prev() prevAll() prevUntil() 查找所有兄弟元素 siblings ...