1、 菜单根据路由来生成,左侧菜单一级栏目要如下设置,纠结不。。。一个路由我还得虚拟一个父路由出来,命名都纠结
{path: '/',name: '_home',redirect: '/home',component: Main,meta: {hideInMenu: false,notCache: true},children: [{path: '/home',name: 'home',meta: {title: '首页',notCache: true,icon: 'md-home'},component: () => import('@/view/home/index.vue')}]}
解决:后台所有路由配置在manage的children里。这样也便于区分一些其他路由,如注册 登录页面,这些页面并不需要登录后才可以访问
export default [{path: '/manage',name: 'manage',meta: {title: '后台管理',hideInBread: true},component: Main,children: [{path: 'home',name: 'home',meta: {title: '首页',sideMenu: true,icon: 'md-home'},component: () => import('@/view/home/index.vue')},]}]
2、 菜单权限控制,iviewui是根据 access:[‘super_admin’, ‘admin’]用户角色来控制的,如下设置路由的access,再根据后台返回的 access,来判断当前路由是否有访问权限。相当于路由是否有权限访问必须提前在前端配置死。不方便后台系统动态配置权限~
{path: 'level_2_2',name: 'level_2_2',meta: {access: ['super_admin'],icon: 'md-funnel',showAlways: true,title: '二级-2'},}
解决
内页由接口层的权限判断值来判断是否有权限
{"code":"00000000","msg":"成功","data":{menuName:["home","member"]}}
3、Modal弹层的问题:异步提交时,不管点取消还是确定,都会把层关掉,没有回调处理函数
解决
4、table的render函数,没官方文档可查,点开竟然是收费的链接,估计官方想创点收入
解决 这个不是什么大问题,摸索解决,网上也有资料
5、使用了Mockjs来模拟数据开发,由于Mockjs只用来输出数据,并没有发送真实的请求,调试起来非常麻烦,要使用console.log输出才知道发送的是啥,到底有没有发送请求,有没有重复发送请求等等
解决 更改为Mocker-api做为项目模拟数据输出,直接读取模拟的JSON数据文件
6、省份城市选择插件iview-area(https://github.com/iview/iview-area),通过表单reset()的时候,数据不能清空
解决 通过refs手动清空
this.$refs.area.select = []
7、针对IE的兼容
babel-polyfill,在main.js里全局引入
import 'babel-polyfill'
tree-table-vue需要注释掉,这个插件不支持IE11。如果你的项目没有用到它的树状列表,完全可以不引入
// 注释这两行import TreeTable from 'tree-table-vue'Vue.use(TreeTable)

vue.config.js文件里添加如下代码。从下可以看到tree-table-vue,v-org-tree,locale都需要重新编译
// webpack配置configureWebpack: {module: {rules: [{test: /\.m?js$/,// exclude用上面配置的话,默认是过滤不编译node_modules 路径下的文件// exclude: /(node_modules|bower_components)/,// include 指定需要编译的文件路径include: [resolve('src'),resolve('node_modules/tree-table-vue/lib'),resolve('node_modules/v-org-tree/dist'),resolve('node_modules/iview/src/locale')],use: {loader: 'babel-loader',options: {presets: ['@babel/preset-env']}}}]}}
AnimationFrame的兼容问题在main.js里添加如下代码:
(function() {var lastTime = 0var vendors = ['ms', 'moz', 'webkit', 'o']for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] ||window[vendors[x] + 'CancelRequestAnimationFrame']}if (!window.requestAnimationFrame) {window.requestAnimationFrame = function(callback, element) {var currTime = new Date().getTime()var timeToCall = Math.max(0, 16 - (currTime - lastTime))var id = window.setTimeout(function() { callback(currTime + timeToCall) },timeToCall)lastTime = currTime + timeToCallreturn id}}if (!window.cancelAnimationFrame) {window.cancelAnimationFrame = function(id) {clearTimeout(id)}}}())
表格如果字段多,有横向滚动条是不是不方便?可拖拽的滚动是不是就方便了?
使用create-vue创建vue3项目,vite,vue3
相对VUE2 ,VUE3做了哪些优化和改进呢?
vue项目,不使用window.location.reload(),如何刷新当前页面?
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
vue2.0 v-html指令有潜在的xss风险,如何解决?
vue项目通过axios怎么下载二进制文件或图片?
ant.design UI框架 同时使用v-model或value属性时, placeholder不显示
如何在VUE项目中添加stylelint,检查css,scss,less的语法问题,保证团队代码的规范统一
VUE全局函数
定义了服务端渲染的属性名称常量SSR_ATTR,定义了一些资产类型常量ASSET_TYPES,定义了生命周期相关钩子函数的函数名称
使用iviewui-admin框架构建管理系统时,遇到的各类问题
vue项目中动态图片路径拼接
vue下filter方法的调用
21个vue顶级UI框架: Vuetify,Quasar,Vue Material,Keen-UI,Buefy,Bootstrap Vue,Muse-UI,AT-UI,Vux,iView,Uiv,Vuikit,Onsen UI+Vue,Semantic UI+Vue,Fish-UI,Mint UI,Framework7 Vue,Cube UI,Vueblu,Ant Design Vue
&amp;amp;quot;.vue&amp;amp;quot;文件是如何解析成js对象的~
立个flag,看过年这段时间能不能把vue的源码读完?多年前看过jQuery的部分源码,如果想要更深入的了解vue,还是得从源码开始
vue源码阅读,慢慢学习
vue的生命周期函数
vue组件的数据data为什么一定要是函数 ?
Mint-ui this.$messagebox点取消时,报错:Uncaught (in promise) cancel
vue-validate使用
这就是个vue的坑。。。
vue如何监听enter事件?
vue使用axios进行form表单提交
vue中如何改变title标题
如果在vue2.0中使用NProgress进度条
Axios 是一个基于 promise 的 HTTP 库,可以用在浏览器和 node.js 中。也是vue2.0官方推荐的,同时不再对vue-resource(vue1.0使用)进行更新和维护
分析Vue.js源码
npm run dev模式下,webpack4+vue2项目下,类似'/user/login'二级路由,刷新时静态资源路径不对,静态资源返回404
[Vue warn]: Error in render: "TypeError: Cannot read property 'matched' of undefined"
did you register the component correctly? For recursive components, make sure to provide the "name" option
vue.js如何查看注册了哪些组件,获取组件名称
vue底层的Virtual DOM就是基于snabbdom修改的