会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
yw3692582
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
15
16
17
18
19
20
21
22
23
下一页
2020年11月19日
Vue中使用WebSocket
摘要: initWebSocket() { //初始化websocket let wsuri = 'ws地址' this.ws = new WebSocket(wsuri) this.ws.onmessage = this.websocketonmessage this.ws.onopen = this.w
阅读全文
posted @ 2020-11-19 09:10 yw3692582
阅读(2042)
评论(0)
推荐(0)
2020年11月17日
Vue中做滑块登录验证
摘要: 1 // 先获取lib文件夹,在博客园里的文件里:https://i.cnblogs.com/files 2 3 // 然后在main.js中引入 4 5 import SlideVerify from './lib/index' 6 7 //Vue.config.productionTip = f
阅读全文
posted @ 2020-11-17 16:26 yw3692582
阅读(1400)
评论(0)
推荐(0)
2020年11月9日
Vue中使用 captcha.min.js 做验证码
摘要: 1 verificationCode() { 2 let captcha1 = new CaptchaMini() 3 captcha1.draw(document.querySelector('#captcha1'), r => { 4 this.Verification = r 5 }) 6 }
阅读全文
posted @ 2020-11-09 10:07 yw3692582
阅读(1522)
评论(0)
推荐(0)
2020年10月16日
JS获取URL地址参数
摘要: 1 getTokenTest() { //传统js方式获取url参数 2 let url = window.location.search 3 let token; 4 let loca_token = localStorage.getItem('token') 5 if (url) { 6 if
阅读全文
posted @ 2020-10-16 22:03 yw3692582
阅读(476)
评论(0)
推荐(0)
Vue中获取URL地址上的参数
摘要: 1 getTokenVue(){//使用vue的this.$route来获取 2 let url = this.$route.query 3 let token; 4 let loca_token = localStorage.getItem('token') 5 let url_string =
阅读全文
posted @ 2020-10-16 22:01 yw3692582
阅读(13752)
评论(0)
推荐(0)
2020年10月14日
JS中两个对象有相同的key时,快速赋值
摘要: 1 let obj1 = { 2 a:1, 3 b:2, 4 c:3 5 } 6 let obj2 = { 7 a:0, 8 b:0, 9 c:0 10 } 11 // 两个对象的字段完全相同时采用下面两种方式 12 obj2 = Object.assign(obj1) 13 obj2 = obj1
阅读全文
posted @ 2020-10-14 17:02 yw3692582
阅读(5054)
评论(0)
推荐(0)
2020年10月13日
Echarts随浏览器窗口变化而变化
摘要: 1 let myChart = echarts.init(document.getElementById('#id')); 2 let option = { 3 //代码块 4 } 5 myChart.setOption(option); 6 7 // 如果页面中有多个图表,则采用此方法 8 win
阅读全文
posted @ 2020-10-13 09:01 yw3692582
阅读(457)
评论(0)
推荐(0)
2020年10月10日
Vue使用高德地图来显示固定的城市
摘要: 1 init() { //地图-固定显示重庆市 2 let _this = this 3 _this.map = new AMap.Map("container", { 4 resizeEnable: true, 5 center: [107.983524, 30.026571], 6 zoom:
阅读全文
posted @ 2020-10-10 17:53 yw3692582
阅读(1801)
评论(0)
推荐(0)
Vue解决打包项目后js文件非常大,导致首次加载页面非常慢
摘要: 1 1、使用cdn方式引入不常修改的第三方插件 2 2、使用路由懒加载,例如: 3 { 4 path: "*", 5 component: resolve => require(['../views/404.vue'],resolve) 6 },// 第二种路由懒加载 component: () =
阅读全文
posted @ 2020-10-10 17:41 yw3692582
阅读(2187)
评论(0)
推荐(0)
Vue解决重复点击链接报错
摘要: 1 // 解决重复点击链接的报错,在router.js中添加 2 const originalPush = Router.prototype.push 3 Router.prototype.push = function push(location) { 4 return originalPush.
阅读全文
posted @ 2020-10-10 17:39 yw3692582
阅读(243)
评论(0)
推荐(0)
上一页
1
···
15
16
17
18
19
20
21
22
23
下一页
公告