12 2021 档案
vue-router 原理及实现
摘要:vue-router作为Vue全家桶实现spa的重要部分主要实现以下功能: 当页面url发生变化,不刷新页面,只改变渲染的组件(通过hash,或者history api) 拆分为以下三部分 1.监听url发生变化,并将url加入响应式数据,使得其他组件会重新执行render 2.提供router-v 阅读全文
posted @ 2021-12-24 11:26 ShawYoi 阅读(487) 评论(0) 推荐(0)
vue3封装Echarts为Vue组件
摘要:一、创建Charts.vue组件 <template> <div class="container" ref="container"></div> </template> <script setup> import {onMounted, ref,defineProps,watch,toRefs} 阅读全文
posted @ 2021-12-23 14:50 ShawYoi 阅读(1930) 评论(0) 推荐(0)
vue项目引入NProgress
摘要:一、安装NProgress yarn add nprogress 二、在router中引入NProgress import NProgress from 'nprogress' // progress bar import 'nprogress/nprogress.css' 三、在路由守卫中配置NP 阅读全文
posted @ 2021-12-23 09:48 ShawYoi 阅读(480) 评论(0) 推荐(0)
Vue3+vite 按需自动引入elementUI (按照官方方法配置失败:Failed to resolve import "element-plus")
摘要:按需自动引入elementUI 首先需要插件 unplugin-vue-components 和 unplugin-auto-import yarn add unplugin-vue-components unplugin-auto-import 根据elementUI plus 官网说明 快速开始 阅读全文
posted @ 2021-12-08 13:46 ShawYoi 阅读(10763) 评论(0) 推荐(0)