Vue学习-小白

2022-08-15  本文已影响0人  米臭了

前提是已经安装了npm和Vue以及脚手架vue-cli

1、创建项目

vue init webpack 项目名

2、进入项目文件夹

cd tab键

3、运行项目

npm run start

4、App.vue全局配置

此文件内的内容不会随路由改变而改变,通常导航条就写在这里
image.png

5、index.js 配置路由

routes对象内配置,一个大括号表示一个路由,path、name、component
path:对应路径
name:名
component:组件 * 需要去src/component文件夹下创建一个vue文件,把HelloWorld文件中的script内容复制过来改吧改吧

image.png

参考文件

https://laravelcode.cn/posts/37/vue-cli-was-introduced-to-bootstrap4
https://router.vuejs.org/zh/guide/essentials/nested-routes.html

上一篇 下一篇

猜你喜欢

热点阅读