Vue scaffolding

installation

npm install -g vue-cli //全局安装脚手架,确定有没有全局安装打开cmd输入vue
vue init webpack vue_demo //使用webpack模板初始化项目 vue_demo是自定义项目名 不能含大写字母

This time there will be many options

? Project name vue_demo //是否使用这个项目名称
? Project description A Vue.js project //使用默认描述
? Author ganmy <1535628743@qq.com> //作者名称默认
? Vue build standalone
? Install vue-router? No //不适用路由
? Use ESLint to lint your code? Yes //使用ESLint 
? Pick an ESLint preset Standard
? Set up unit tests No //不使用unit测试框架
? Setup e2e tests with Nightwatch? No //不使用Nightwatch测试框架

Custom Installation

 cd .\VueDemo\
 npm install
 npm run dev  // 这里用npm start 也可以

Bale

npm run build
serve dist

If you do not have to install installation serve

npm install -g serve

So that you can access localhost://5000the
project name after the change, if packaged in webpack.prod.conf.jsthe inside with outpu

publicPath: '/vue_demo/'

Turn off the check

eslint spec check code will be turned off, the .eslintignoreinside with

*.js
*.vue

By value

full version

  props: {
        //指定属性名和属性值的类型
        comment: Object
    }

Abbreviated version

 //声明接收属性 这种方式只指定了属性名
    props: ['comments'],

Guess you like

Origin blog.csdn.net/qq_36939013/article/details/90741659