判断不准就用js处理出用户权限的中文字段,没处理出来的字段为空就不显示,毕竟true和false的判断渲染前都要默认显示一个
微信小程序怎么设置不同用户权限?<view class="btn-user" wx:if = '{{!authority}}'> <view class="svip">普通会员</view> </view> <view class="btn-user" wx:if="{{authority}}"> <view class="svipS">SVIP</view> </view> [图片]
2022-05-05下面的被划掉了,说明浏览器用下面的样式替换了,把-moz去掉吧,用webkit的
【已解决】多列布局「column-span: all」不生效?[图片] [图片] .category { column-count: 2; } .categoryName { column-span: all; -moz-column-span: all; -webkit-column-span: all; } 这是为何? ----------------------- 已解决: 应该是<text>不是block-level元素的缘故吧。 [图片] https://developer.mozilla.org/zh-CN/docs/Web/CSS/column-span
2022-04-29接口要求的canvas组件没找到,你的这是弹窗吧,等组件渲染出来了再去获取
为什么wx.canvasToTempFilePath canvas生成图片保存时有的手机报错?有的手机报错canvastotempfilepath: fail canvas is empty 有的手机正常生成图片 开发者工具完全没问题 [图片][图片]
2022-04-29要求一个图片类型,检查一下参数值
wx.canvasToTempFilePath报错,怎么解决?let that = this let imageInfo = await App.wxp.getImageInfo({ src: "https://xxx.com/files/sharePoster.jpg" }); console.log("图片信息", imageInfo); if (imageInfo.path) { // 创建离屏画布 let canvas = wx.createOffscreenCanvas({ type: '2d', width: imageInfo.width, height: imageInfo.height }); console.log("canvas", canvas); let context = canvas.getContext('2d') // 创建海报图片 const sharePoster = canvas.createImage() sharePoster.src = imageInfo.path sharePoster.onload = e => { // 把图片画到离屏 canvas 上 context.clearRect(0,0, canvas.width, canvas.height); context.drawImage(sharePoster, 0, 0, imageInfo.width, imageInfo.height, 0, 0, imageInfo.width, imageInfo.height); let base64 = context.canvas.toDataURL('image/png'); console.log(base64); // base64可以正常显示图片 that.setData({ src: base64, invite: true }) setTimeout(() => { // 报错:Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The provided value is not of type '(CSSImageValue or HTMLImageElement or SVGImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap or OffscreenCanvas)' wx.canvasToTempFilePath({ canvas: canvas, // canvas type="2d" 时使用该属性 complete(res) { console.log("tempFilePath", res); } }, that) // 有无this都会报错 }, 1000); } } 小程序调用wx.canvasToTempFilePath报错Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The provided value is not of type '(CSSImageValue or HTMLImageElement or SVGImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap or OffscreenCanvas) 开发者工具版本:稳定版1.05.2204180(windows)调试基础库版本:2.24.0
2022-04-29上一段代码是什么意思?是你操作时就是点到了吧
textarea中输入完会触发上一段代码的click事件?textarea中输入完会触发上一段代码的click事件 安卓机调试没有问题 ios就会这样
2022-04-29循环获取,或者selectAll
在自定义组件中如何获取多个view的高度?[图片][图片][图片] 现在只能获取到一个高度,如何获取多个view 被内容撑开的高度
2022-04-29你这写法是官方的么?感觉你学的知识是拼凑出来的,再翻一下文档看下吧
【已解决】自定义tabBar无法触发页面wxs的prop监听事件?需求:当自定义tabBar其中一个tab被点击时,显示另外一个自定义组件A。 思路:通过在page.wxml中添加wxs模块,监听tabBar的prop,以触发A组件的显示。 问题:wxs监听事件无法被触发。 // custom-tab-bar.js Component({ data:{showStudioMenu:false}, methods:{ whenTap:function(){this.setData({showStudioMenu:true})} } }) // custom-tab-bar.wxml <view change:showStudioMenu="{{sm.propObserver}}" > <view wx:for="{{normal}}" wx:key="index" id="{{index}}" bindtap="whenTap" > <image src="{{item}}" /> </view> </view> // page.wxml <wxs module="sm"> var propObserver = function (nv,v,oi,i) { console.log("sm.propObserver被执行"); // 不执行... console.log(nv,v,oi,i); // 不执行... } module.exports.propObserver = propObserver </wxs> --------------------------------- 总结: 1、tabBar和页面是兄弟。 2、两兄弟如果一定要通信,page里用getTabBar()后setData(),tabBar里用getCurrentPages()后setData()。
2022-04-28大兄弟,你贴的这个左右分开的代码是想怎么样?
addMarkers添加聚集点在开发工具上能用,在真机调试上显示不出点?请问是什么回事for (let i in markersData) { const newMarker = { id: 1, iconPath: '../../static/pointDevice.png', width: 50, height: 50, joinCluster: true, // 指定了该参数才会参与聚合 label: { width: 50, height: 30, borderWidth: 1, borderRadius: 5, borderColor:'#138FE3', bgColor: '#ffffff', anchorX: 0, anchorY: -10, content:'' } } newMarker.id = i +1 newMarker.latitude = markersData[i].lat newMarker.longitude = markersData[i].lon newMarker.label.content = markersData[i].species newMarker.clusterId = markersData[i].id this.markerListData.push(newMarker.id) markers.push(newMarker) } // console.log(markers,'asdafdasf') this.mapContext.addMarkers({ markers:markers, clear: true, complete(res) { console.log(res,'complete') }, success(res){ console.log(res,'成功') } })
2022-04-28起点0%的140是s,终点100%的200是e,差值diff = e - s,区间任意数 x,那这个数的百分比是 per = (x - s) / diff,即 (x - s) / (e - s),则160就是三分之一
一个算术问题?0%是140 100%是200 160是百分之多少? 这个是用什么计算公式?
2022-04-28更像素密度有关,相关的可以上网查查,比方说iphone6是375,放750个像素点和iphone5是320放750个像素点密度是不一样的,另外小程序单位转换时会舍弃小数点位
微信开发工具中,机型选择iPhone6, rpx和px关系为什么不是严格的2倍?微信开发工具机型选为iPhone6/7/8 (375*667 |Dpr:2)的情况下,rpx和px的关系为什么不是严格的2倍呢 下面一个页面中截取的四张图,只有第一张height:58rpx,实现的具体高度是29px [图片][图片] [图片][图片]
2022-04-27