/vue-demo

入门级vue-demo

Primary LanguageJavaScript

vue-demo

A Vue.js project

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

# run unit tests
npm run unit

# run all tests
npm test

For a detailed explanation on how things work, check out the guide and docs for vue-loader. 在Vue中关闭Eslint 的方法 build文件夹--->webpack.base.conf.js---->module

router-link制作导航 [显示字段]

vue-router配置子路由 hi子页面 子路由写法 { path: '/hi', component: Hi, children: [ { path: 'hi1', component :RouterChildPage1 } ] }

vue-router传参

1,用name传递参数

{{ $route.name}}

2,通过标签中的to传参 {{$route.params.key}}

3,url传参 hi页面 path: '/hi/:newsId/:newsTitle' {{$route.params.newsId}}

单页面多路由区域操作

{ path: '/', name: 'HelloWorld', components:{ default:HelloWorld, leftPage:Left, rightPage:Right } }