已解决
小程序出现这种情况是什么原因?[图片]
2020-04-10使用vuecli创建一个vue项目使用videojs的组件就行了
小程序用web-view内嵌h5页面(引用vue.js写的)如何用videojs?[图片]
2020-04-07小程序中class里面的写法与vue中有差异,小程序必须通过三元运算来判定返回什么class,如{{item.radioType==xx?'xx':'yy' }}
动态通过遍历数组动态改变class中的值,class中的值无法同步更新,但非class中的可以同步https://developers.weixin.qq.com/miniprogram/dev/devtools/devtools.html js中data:items [ nameUSA value美国 radioType:radio_default }, nameCHN value中国 checkedtrue radioType:radio_default }, nameBRA value巴西 radioType:radio_default }, nameJPN value日本 radioType:radio_default }, nameENG value英国 radioType:radio_default }, nameFRA value法国 radioType:radio_default }, ] radioChange方法主要更新选中的状态 radioChange: function (e) { let newItems = JSON.parse(JSON.stringify(this.data.items)); newItems.map(item => { if (item.name == e.detail.value) { item.checked = true; } else { item.checked = false; } }) this.setData({ items: newItems }) }, submit方法中根据选择结果更新class中的样式 submit() { let newItems = JSON.parse(JSON.stringify(this.data.items)); let isOk = true; newItems.map(item => { if (item.checked && item.value !== "中国") { item.radioType = "radio_error"; isOk = false; } if (item.value == "中国") { item.radioType = "radio_success"; } }); if (!isOk) { console.log("newItems", newItems); this.setData({ items: newItems }); console.log(this.data.items)//这里输出的结果是正常更新的 } } } 页面中显示的结果class里面的{{item.radioType}}还是以前的 radio_default 而text标签里面已经更新成了相应的值 如中国选项 的 radio_success <radio-group class="radio-group" bindchange="radioChange"> <radio class="radio {{item.radioType}}" wx:for="{{items}}" wx:key="index" value="{{item.name}}" checked="{{item.checked}}" disabled="{{showAnswer}}"> <text>{{item.value}} {{item.radioType}}</text> </radio> </radio-group> 请问如何才能同步更新呢?
2020-04-01总结:1、npm init -y 初始化项目 2、npm install weui-miniprogram 3、点击工具下的构建npm 4、app.json里面(微信开放者工具下面版本:useExtenedLib去掉也能用),暂时没有发现不通过上述3步仅设置第四步的方式可以引用的方法 [图片] "useExtenedLib":{ "weui":true } 5、在所需页面的json文件里面引用weui组件 "mp-search":"/weui-miniprogram/searchbar/searchbar"
有没有下列引用weui方式的代码片段?[图片]
2020-03-31样式必须否则不显示,echarts和wxcharts不能共存 /**index.wxss**/ ec-canvas { width: 100%; height: 200px; } .container { position: absolute; top: 0; bottom: 0; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between; box-sizing: border-box; } <!--index.wxml--> <view class="container"> <ec-canvas id="mychart-dom-bar" canvas-id="mychart-bar" ec="{{ ec }}"></ec-canvas> </view> import * as echarts from '../../ec-canvas/echarts'; Page({ onLoad() { this.barComponent = this.selectComponent('#mychart-dom-bar'); this.getToken(); }, init_bar: function () { this.barComponent.init((canvas, width, height) => { // 初始化图表 const barChart = echarts.init(canvas, null, { width: width, height: height }); barChart.setOption(this.getBarOption()); // 注意这里一定要返回 chart 实例,否则会影响事件处理等 return barChart; }); }, getBarOption: function () { var _this = this; //return 请求数据 var option = {} return option; }, getToken() { wx.showLoading({ title: '加载中', }) let _this = this; wx.request({ url: url, method: "get", complete() { wx.hideLoading(); }, success(res) { _this.getData(); }, fail(err) { console.log(err); } }) }, getData() { var _this = this; wx.request({ url: url, header: { 'content-type': 'application/x-www-form-urlencoded', "Authorization": "bearer " + _this.data.token }, method: "post", data:{} complete() { }, success(res) { if (res.data.Code == 200) { var result = res.data.Result; _this.init_bar(); } else { }) } } }) }, });
echarts如何用传入wx.request请求的数据?微信小程序中使用echarts测试只能按照官方的这种顺序写,否则echarts图出不来,但这种如何传入wx.request请求的数据呢? [图片]
2020-03-20我也遇到了这个弹框
getUpdateManager,点击确定,出现调试升级?[图片] 请问调试升级,不调试升级,为什么会有调试字样? 官方能不能呢个反馈一下
2020-03-17还是用wx:if 了
hidden属性的值是boolean类型 true时隐藏不了如hidden=“{{a==b?true:false}}”
2020-03-10重启工具就好了
js文件里面没法复制代码js文件里面没法复制代码
2020-03-09 /** * 页面的初始数据 */ items [ nameUSA value美国 radioTyperadio_default }, nameCHN value中国 checkedtrue radioTyperadio_default }, nameBRA value巴西 radioTyperadio_default }, nameJPN value日本 radioTyperadio_default }, nameENG value英国 radioTyperadio_default }, nameFRA value法国 radioTyperadio_default }, ] showModalfalse showAnswerfalse buttonMsg提交 }, showAnswerInfofunction() thissetData showModaltrue }, closefunction() thissetData showModalfalse }, radioChangefunction letnewItemsJSONparseJSONstringifythisdataitems)) newItemsmapitem=> if (itemname==detailvalue) itemcheckedtrue else itemcheckedfalse thissetData itemsnewItems }, submit() if (thisdatabuttonMsg==提交) letnewItemsJSONparseJSONstringifythisdataitems)) letisOktrue newItemsmapitem=> if (itemchecked&&itemvalue!==中国) itemradioTyperadio_error isOkfalse if (itemvalue==中国) itemradioTyperadio_success if (isOk) consolelognewItemsnewItems thissetData showAnswertrue buttonMsg下一题 itemsnewItems consolelogthisdataitems }else{ // 下一题 thissetData showAnswerfalse buttonMsg提交 }
在控制台调试box-shawdow 样式 只能调动第一个数字https://developers.weixin.qq.com/miniprogram/dev/devtools/devtools.html [图片]在控制台中调试box-shadow将光标定位到第二个1px处,想要将第二个1px调动下,结果变动的还是第一个1px
2019-12-26