上一页 1 ··· 36 37 38 39 40 41 42 43 44 ··· 76 下一页
摘要: 根据menu属性router来实现, router属性:是否使用 vue-router 的模式,启用该模式会在激活导航时以 index 作为 path 进行路由跳转 将router的属性值设置为true即启用router属性。 <el-menu default-active="/main/dataS 阅读全文
posted @ 2021-12-05 09:58 周文豪 阅读(559) 评论(0) 推荐(0)
摘要: 报错如下: 解决办法:引入jquery 1)、安装jquery cnpm i jquery -s 2)、main.js中引入 import $ from 'jquery' window.jQuery = $;window.$ = $; 阅读全文
posted @ 2021-12-04 22:27 周文豪 阅读(1768) 评论(0) 推荐(0)
摘要: 看如下代码: import Vue from "vue"; import Vuex from "vuex"; import getters from "./getters"; Vue.use(Vuex); const modulesFiles = require.context("./modules 阅读全文
posted @ 2021-12-04 21:38 周文豪 阅读(88) 评论(0) 推荐(0)
摘要: 一、常规方式 1)、先引入 import user from './modules/user' import app from './modules/app' import settings from './modules/settings' 2)、注册到modules中 modules: { us 阅读全文
posted @ 2021-12-04 21:07 周文豪 阅读(474) 评论(0) 推荐(0)
摘要: 路由导航守卫如下: router.beforeEach(async (to, from, next) => { document.title = to.meta.title; // 路由发生变化时候修改页面中的title const hasToken = store.getters.token; i 阅读全文
posted @ 2021-12-04 16:46 周文豪 阅读(1210) 评论(0) 推荐(0)
摘要: meta简单来说就是路由元信息,也就是每个路由身上携带的信息。 当我们做面包屑功能时,会用到meta。 面包屑效果如下: router/index.js中代码如下: { path: '/backstage', component: Layout, redirect: '/backstage/menu 阅读全文
posted @ 2021-12-04 16:12 周文豪 阅读(1805) 评论(0) 推荐(0)
摘要: 当打开页面时,添加事件监听,即监听beforeunload事件,beforeunload事件在关闭页面时触发。即当关闭页面时,手动删除localStorage中的数据。 app.vue中的代码如下: <template> <div id="app"> <router-view /> </div> < 阅读全文
posted @ 2021-12-03 17:49 周文豪 阅读(4483) 评论(0) 推荐(0)
摘要: vue中全局设置样式有两种方法: 第一种:只需要在main.js中引入 如global.css html,body,#app{ height: 100%; margin: 0px; padding: 0px; } 在main.js中引入 import "./styles/index.scss";im 阅读全文
posted @ 2021-12-03 16:59 周文豪 阅读(6528) 评论(0) 推荐(2)
摘要: 执行npm run build打包后,生成的dist文件如下: 1、当设置publicPath为/时 修改vue.config.js文件 module.exports = { publicPath: '/', configureWebpack: { resolve: { //设置别名 alias: 阅读全文
posted @ 2021-12-03 15:30 周文豪 阅读(3825) 评论(0) 推荐(0)
摘要: 一、内网穿透基本原理 内网穿透又叫 NAT 穿透,常用的工具有很多,比如 ngrok、花生壳、frp等 FRP:高性能反向代理应用,支持tcp、udp、http、https协议。 frp 的作用 利用处于防火墙后的机器,对外网环境提供 http 或 https 服务。 对于 http, https 阅读全文
posted @ 2021-12-02 19:04 周文豪 阅读(830) 评论(0) 推荐(0)
上一页 1 ··· 36 37 38 39 40 41 42 43 44 ··· 76 下一页