vue学习
记录自己学习Vue的过程
Feolu
这个作者很懒,什么都没留下…
展开
-
Vue项目报错:Browserslist: caniuse-lite is outdated.进度卡死
在修改过代码后,重新启动项目,进度卡在69%不动弹报错Browserslist: caniuse-lite is outdated.原因:某组件不止一个根元素(Vue2.X)原创 2021-06-02 16:42:19 · 903 阅读 · 0 评论 -
vue-router学习笔记
安装npm intall vue-router --save使用router/index.js文件中import Vue from 'vue'import VueRouter from 'vue-router'// 导入路由对象Vue.use(VueRouter) // 配置路由和组件之间的应用关系const routes = [ { path: '/home', component: Home }, { path: '/about', comp原创 2021-01-30 23:40:57 · 63 阅读 · 0 评论 -
vue 修改tab标签文字
方法一 created()函数在对应组件的created()中不好用,几个组件要写几次created () { document.title="首页" }方法二在router/index.js中好用!!!推荐!!!{path:'/home',component:Home,meta:{ title:'首页' }}// 文件下面进行路由导航设置router.beforeEach((to, from, next) => {// 从from 跳转到 tod原创 2021-01-30 22:41:31 · 1586 阅读 · 0 评论 -
vuex学习
vuex:专为Vue.js应用程序开发的状态管理模式。vue设置一个常量在其他地方使用// 定义const shareObj = { name:'why'}// 全局Vue.prototype.shareObj = shareObj// 使用console.log(this.shareObj.name)Vuex的使用场景在多个界面间的共享问题用户的登录状态、用户名称、头像、地理位置信息等等商品的收藏、购物车中物品等等。状态显示在视图上,视图上可以进行一些行为,行为可.原创 2021-01-27 19:14:35 · 133 阅读 · 0 评论 -
axios学习笔记
axios的基本使用默认是get请求,params是为get请求传参时使用axios({ url: '', params: { }}).then(res => { console.log(res)})axios发送并发请求axios.all()axios.all([axios( { url: '' }), axios({ url: '', params: {}})]).then(result => { console.log(re原创 2021-01-19 22:41:55 · 133 阅读 · 0 评论 -
html中引入Vue 代码结构
html中引入Vue在正式使用Vue单页面结构前,在html中使用vue。<!DOCTYPE html><html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>01 html中引入Vue</titl原创 2020-12-16 16:11:02 · 687 阅读 · 0 评论 -
vue的三种安装方式
方法一 CDN引入<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>方法二 下载和引入方法三 npm 引入npm install vue原创 2020-12-13 22:53:12 · 812 阅读 · 0 评论