摘要: const originalReplace = Router.prototype.replace; Router.prototype.replace = function replace(location) { return originalReplace.call(this, location). 阅读全文
posted @ 2021-11-08 14:09 秋雁丁 阅读(333) 评论(0) 推荐(0)
摘要: 在 main.js 中 // 点击页面中的任意位置 方法 Vue.prototype.globalClick = function(callback) { document.onclick = function() { callback(); }; }; 其中 callback() 方法为组件中的方 阅读全文
posted @ 2020-05-10 21:41 秋雁丁 阅读(2795) 评论(0) 推荐(0)
摘要: 打包完后出现空白页 修改:config 文件下的 index.js,大概在46行左右 原:assetsPublicPath:'' 改:assetsPublicPath:'./' Element-UI 图标不显示 修改:build 文件夹下的 utils.js,大概在51行左右 原: if (opti 阅读全文
posted @ 2020-05-07 18:09 秋雁丁 阅读(868) 评论(0) 推荐(0)
摘要: 父组件 <template> <div> <Son :sendToSonAttribute = "fromFatherMsg"></Son> <div> </template> <script> export default{ data(){ return { fromFatherMsg:'我是来自 阅读全文
posted @ 2020-05-06 17:41 秋雁丁 阅读(133) 评论(0) 推荐(0)
摘要: cnpm i axios 更多使用教程参考 https://www.kancloud.cn/yunye/axios/234845 //main.js 文件中 import axios from 'axios' Vue.prototype.$axios = axios; //Vue 组件中使用案例 t 阅读全文
posted @ 2020-05-06 16:30 秋雁丁 阅读(155) 评论(0) 推荐(0)
摘要: import Element from 'element-ui' import 'element-ui/lib/theme-chalk/index.css' Vue.use(ElementUI) //该方法是全局引入 element-ui npm 最好提前替换成 淘宝源 cnpm cnpm i el 阅读全文
posted @ 2020-05-06 16:25 秋雁丁 阅读(167) 评论(0) 推荐(0)
摘要: .router-link-exact-active{ /* 路由点击后的样式 */ /* 添加需要的样式 */ } router-link 本质是 a 标签,也可以更改 a 标签的样式。 阅读全文
posted @ 2020-05-06 14:17 秋雁丁 阅读(4115) 评论(0) 推荐(0)
摘要: 需提前引入 JQuery.js 。 // 判断 返回顶部 按钮的出现与消失 $(window).on('scroll', function() { if ($(window).scrollTop() > 500) { $('#backTop').fadeIn('slow'); } else { $( 阅读全文
posted @ 2020-04-24 15:12 秋雁丁 阅读(117) 评论(0) 推荐(0)