logo
publist
写文章

简介

该用户还未填写简介

擅长的技术栈

可提供的服务

暂无可提供的服务

JS中判断JSON数据是否存在某字段的方法 JavaScript中判断json中是否有某个字段

方式一 !("key" in obj) 方式二 obj.hasOwnProperty("key")  //obj为json对象。例如:var jsonworld_pose = JSON.parse(data[0].world_pose);var jsonorientation = jsonworld_pose.orientation; //次处可能为unde

#json
vue 图标简单抖动晃动效果

<div class="fixed-box" ><img class="rotate" :class="[{'r1': shrinkPacket}, {'r2': !shrinkPacket}]" src="../../../assets/images/consume_packet.png"/></div>.fixed-box {position: fixed;

#css3#vue.js
vue 微信h5页面跳转到小程序 wx-open-launch-weapp(多个)

微信官方文档:微信官方文档微信版本要求为:7.0.12及以上。 系统版本要求为:iOS 10.3及以上、Android 5.0及以上。1、先请求接口配置微信需要的一些参数// 需要先请求后端接口let url = window.location.href.split("#")[0];let shareConfig = await shareViewAPI.getWechatConfig({url}

#小程序
vue单页面如何在后退时返回到上次滚动位置

第一种方法、在main.js里面,此时模式mode要为 history,页面需要设置<keep-alive ><router-view v-if="$route.meta.keepAlive"></router-view></keep-alive> 做缓存const router = new VueRouter({mode: 'hi...

vue+Notification(浏览器通知)

created() {if (window.Notification) {// 浏览器通知--window.Notificationif (Notification.permission == "granted") {console.log("允许通知")}else if( Notification.permission != "denied"){console.log("需要通知权限").

vue拖动改变div宽度

TextWidthChange(e) {let odivParent = e.currentTarget.parentNode; //获取目标父元素let dx= e.clientX;//当你第一次单击的时候,存储x轴的坐标。let dw= odivParent.offsetWidth;//存储默认的div的宽度。docum...

vue中关于后端返回文件流后前端如何下载及自定义名称

前端实现下载excel、img、zip....方法有两种1. 直接调接口进行下载 后端进行处理多GET请求2. 调取接口返回对应的文件流,前端进行处理多POST请求axios.get("/dq/task/record/detail/excel/exportDetail2?id=2", {responseType: 'blob'// zip文件流需要添加,不然文件无法...

#javascript
使用vue实现tab操作

我这里总结了下实现tab功能的3个思路,仅供参考。1. 切换content或者直接切换内容这种思路下,我们首先把结构搭建起来,然后用一个变量selected表示tab当前展示的位置,给li标签添加mouseenter或click事件,将当前的index传递进去: html代码:<div class="hd"><ul class=&quo

vue的微信语音功能,录音+对接口返回amr音频播放

vue的微信语音功能,录音+对接口返回amr音频播放最近的新项目需要调用微信的录音功能,但是后台又不给音频转码,无奈之下就踏上了研究前端音频编码器这东西。...

#前端
vue-cli安装出错问题

错误:PS C:\WINDOWS\system32> npm install vue-cli -gnpm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)npm ERR! code EINTEGRITYnpm ERR!

    共 31 条
  • 1
  • 2
  • 3
  • 4
  • 请选择