摘要: vue 读取本地.txt文件 methods: { getdev() { // 更新数据devInfo.txt文件接口 let xhr = new XMLHttpRequest(), okStatus = document.location.protocol "file:" ? 0 : 200; x 阅读全文
posted @ 2021-02-22 17:44 搜戴斯 阅读(11631) 评论(0) 推荐(0) 编辑
摘要: vue indexedDB的使用 import Idb from 'idb-js' // 引入Idb import db_student_config from './db_student_config' // 引入数据库配置 methods: { getdev() { Idb(db_student 阅读全文
posted @ 2021-02-22 17:43 搜戴斯 阅读(1259) 评论(0) 推荐(0) 编辑
摘要: vue LocalStorage的使用 //设置LocalStorage localStorage.setItem('deviceData',JSON.stringify(res)); //获取LocalStorage localStorage.getItem('deviceData'); 阅读全文
posted @ 2021-02-22 17:42 搜戴斯 阅读(145) 评论(0) 推荐(1) 编辑
摘要: vue 引入pako解压与压缩字符串 import pako from 'pako' //引入pako解压与压缩字符串 methods: { // 设备浏览-加载设备信息 getDeviceInfo() { let that = this; //后端接口获取压缩数据 getDeviceInfo(). 阅读全文
posted @ 2021-02-22 17:37 搜戴斯 阅读(2370) 评论(0) 推荐(0) 编辑
摘要: data() { return { intervalId:null, // 定时器 }; }, methods: { // 定时刷新数据函数 30s // 参考教程-> https://www.cnblogs.com/aurora-ql/p/13300202.html dataRefreh() { 阅读全文
posted @ 2021-02-22 16:30 搜戴斯 阅读(111) 评论(0) 推荐(0) 编辑
摘要: created() { //页面刚进入时开启长连接 this.initWebSocket(); }, destroyed: function () { //页面销毁时关闭长连接 this.websocketclose(); }, methods: { initWebSocket() { //初始化w 阅读全文
posted @ 2021-02-22 16:28 搜戴斯 阅读(334) 评论(0) 推荐(0) 编辑
摘要: mounted() { // 监听浏览器窗口大小变化 window.onresize = () => { return (() => { this.clientWidth = document.body.clientWidth-210; this.clientHeight = document.bo 阅读全文
posted @ 2021-02-22 15:51 搜戴斯 阅读(704) 评论(0) 推荐(0) 编辑