摘要: const createRouter = () => new Router({ // mode: 'history', // require service support scrollBehavior: () => ({ y: 0 }), routes: constantRoutes }) con 阅读全文
posted @ 2020-10-15 09:48 举个栗子走天下 阅读(3082) 评论(0) 推荐(1) 编辑
摘要: - vue-element-admin中,permission主要负责全局路由守卫和登录判断,希望通过以下注释说明,帮助大家理解这个文件的逻辑 import router from './router'import store from './store'import { Message } fro 阅读全文
posted @ 2020-10-15 09:28 举个栗子走天下 阅读(7601) 评论(0) 推荐(0) 编辑
摘要: VUE管理系统项目中,在不刷新页面的情况下,更新页面。 // 先注册一个名为 `redirect` 的路由<script>export default { beforeCreate() { const { params, query } = this.$route const { path } = 阅读全文
posted @ 2020-10-15 09:17 举个栗子走天下 阅读(921) 评论(0) 推荐(0) 编辑
摘要: Vue本地代理举例: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 module.exports = { publicPath: './', devServer: { pr 阅读全文
posted @ 2020-10-14 15:16 举个栗子走天下 阅读(432) 评论(0) 推荐(0) 编辑
摘要: 一劳永逸的方法: 使用cors方式,全称 Cross Origin Resource Sharing (跨域资源共享),只要第一次配好,之后不管有多少接口和项目复用都ok,而且不管是开发环境还是测试环境都能方便的使用(主要由后端配置)。 前端操作跨域的方法: 在dev开发模式下可以使用webpack 阅读全文
posted @ 2020-10-14 15:10 举个栗子走天下 阅读(96) 评论(0) 推荐(0) 编辑
摘要: npm install postcss-px-to-viewport --save-dev module.exports = { plugins: { autoprefixer: {}, "postcss-px-to-viewport": { viewportWidth: 375, // 视窗的宽度 阅读全文
posted @ 2020-10-13 09:30 举个栗子走天下 阅读(13037) 评论(1) 推荐(0) 编辑
摘要: import axios from 'axios' import { $t } from '../lang/index' import { Toast } from 'cube-ui' import store from '../store' import { getToken } from './ 阅读全文
posted @ 2020-10-13 09:12 举个栗子走天下 阅读(261) 评论(0) 推荐(0) 编辑
摘要: import axios from 'axios' import { MessageBox, Message } from 'element-ui' import store from '@/store' import { getToken } from '@/utils/auth' // crea 阅读全文
posted @ 2020-10-13 09:07 举个栗子走天下 阅读(301) 评论(0) 推荐(0) 编辑
摘要: 同步发布于:http://mjzhang.cn/(转载请说明此出处)。 JavaScript是ECMAScript的实现和扩展,ES6标准的制定也为JavaScript加入了许多新特性。本文主要记录展开运算符。 展开运算符(spread operator)允许一个表达式在某处展开。展开运算符在多个参 阅读全文
posted @ 2020-10-10 09:36 举个栗子走天下 阅读(1231) 评论(0) 推荐(0) 编辑
摘要: webpack提高配置速度以及性能优化使用插件DllReferencePlugin和插件DllPlugin,因为vue cli3内置了webpack所以一般情况下webpack.config.js不会暴露出来,如果需要修改webpack.config.js默认配置可以创建vue.config.js文 阅读全文
posted @ 2020-10-10 09:22 举个栗子走天下 阅读(79) 评论(0) 推荐(0) 编辑