- 博客(4)
- 收藏
- 关注
原创 小程序中target和currentTarget以及mark的区别
首先是target和currentTargetcurrentTarget获取事件绑定的元素上边的data属性,而target获取被触发的元素上的data属性代码如下:<view class="titlelist" mark:ind='{{0}}' data-ind = "{{101}}" bindtap='changeactive'> <view class="{{navlist === 1? 'activelist':''}}" hover-class="none" h
2022-03-02 14:56:38
470
原创 本地图片文件转为base64格式
因为blob格式的图片存在一些访问渲染问题,因此想着能不能转为base64的进行渲染,找来的很多方法都不能使用,最终找到了以下方法主要是使用readAsDataURL()将文件转化为base64格式,然后用FileReader的onload方法获取成功后的值,要注意的是onload方法中this指向的是FileReader实例,想在其中使用外部的方法需要用变量接收外部的上下文环境 var img = document.getElementById('filepick') const t
2021-12-29 11:26:22
1239
原创 自己的网站使用百度搜索
switch (name) { case '网页': this.searchUrl = 'http://www.baidu.com/s?wd=' break case '图片': this.searchUrl = 'https://image.baidu.com/search/index?tn=baiduimage&word=' break case '新闻': ..
2021-12-21 15:54:51
369
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人