小程序
文章平均质量分 66
废柴英雄
这个作者很懒,什么都没留下…
展开
-
call、apply、bind的使用方法及区别
作用:这三个函数的作用都是用来改变this的指向 call使用方法 fn.call(thisArg, arg1, arg2, arg3 ...) function fn1() { console.log(this) } const obj = { a: 1 } fn1.call(obj, 1, 2, 3, 4) // {a: 1} 复制代码 apply的用法 fn.apply(thisArg, [arg1, arg2, arg3...]) function fn1() { conso转载 2021-01-12 18:18:05 · 166 阅读 · 0 评论 -
小程序左滑动删除功能
<view data-index='{{index}}' bindtouchstart="touchS" bindtouchmove="touchM" bindtouchend="touchE" data-index="{{index}}" class="inner txt" style="{{item.txtStyle}}"></view> ========================= 将上面标签套在需要有左滑删除功能的标签上================== del.原创 2020-05-16 14:21:18 · 272 阅读 · 0 评论 -
微信小程序图片上传,删除
photographClick: function() { var that = this; wx.chooseImage({ count: 9, // 默认9最大一次上传九张 sizeType: [‘original’, ‘compressed’], // 可以指定是原图还是压缩图,默认二者都有 sourceType: [‘album’, ‘camera’], // 可以指定来源是相册还是相机,默认二者都有 success: function(res) { // 返回选定照片的本地文件路径列表,tempF原创 2020-05-16 14:10:14 · 497 阅读 · 0 评论