第一课 vue3安装与项目初始化
npm install -g @vue/cli
vue create my-project
一、清除无用代码
1)App.vue
<template>
<div id="app">123</div>
</template>
<style lang="scss"></style>
2)components文件夹里的文件删除
3)views文件夹里的文件删除
4)router/index.js,清除路由里的内容
import { createRouter, createWebHashHistory } from 'vue-router'
const routes = []
const router = createRouter({
history: createWebHashHistory(),
routes
})
export default router
二、安装必要插件,并且做重置样式
1)normalize.css解决浏览器兼容的重置样式
cnpm i normalize.css --save
在main.js中引入
import 'normalize.css'
2)在src下新建style/base.scss
- 在main.js中引入import './style/base.scss'
三、切换谷歌浏览器移动端调试
点键盘的f12