请问解决了吗?我也遇到了相同的问题
tabs 选项卡组件 如何设置 swiperClass等同于子元素高度?tabs 选项卡组件 如何设置 swiperClass等同于子元素高度? DEMO 中 swiperClass = weui-tabs-swiper ,默认是100px。但是怎么确认(<view class="tab-content" slot="tab-content-{{index}}"> )里面的子元素高度呢? .weui-tabs-swiper { width: 100%; height: 100px; } https://developers.weixin.qq.com/miniprogram/dev/extended/component-plus/tabs.html
2020-04-01同样一个函数,我用一个循环代替db.command.in,代码如下: // 云函数入口文件 const cloud = require('wx-server-sdk') cloud.init({ env: 'my_env' }) const db = cloud.database({ env: 'my_env' }) // 云函数入口函数 exports.main = async(event, context) => { const _ = db.command for(let i = 0,len = event.ids.length;i < len;i++) { var res = await db.collection(event.database_collection_name).doc(event.ids[i]).update({ data: { liked: _.inc(1) } }) console.log(res) } } 就能正常生效了,但是云函数的预算时间(即计费时间从十几ms上升到了70ms)
db.command.in云调用在本地生效在云上不生效?我有一个云函数,目的就是将名为`event.database_collection_name`的collection中一组指定id的数据中liked字段加一,代码如下: // 云函数入口文件 const cloud = require('wx-server-sdk') cloud.init({ env: 'my_env' }) const db = cloud.database({ env: 'my_env' }) // 云函数入口函数 exports.main = async(event, context) => { // console.log(event.database_collection_name) // console.log(event.ids) 这里确保输入的正确性 const _ = db.command db.collection(event.database_collection_name).where({ _id: _.in(event.ids) }).update({ data: { liked: _.inc(-1) }, success: function (res) { console.log(res) }, fail: function (e) { console.log(e) } }) } 者这个函数在本地调试时能够正常生效,同样的测试数据,云端测试结果返回OK但是数据库中数据没有改变。
2020-03-20楼主解决了吗?我也有同样的问题~
自定义组件绑定wx:if无法实现动画效果自定义组件模板 [代码]<view class=[代码][代码]"x-modal"[代码] wx:if="visable"[代码]>[代码][代码] [代码][代码]<view class=[代码][代码]"x-modal-mock"[代码] [代码]animation=[代码][代码]"{{mockAnimateData}}"[代码][代码]></view>[代码][代码] [代码][代码]<view class=[代码][代码]"x-modal-container flex flex-align-center "[代码] [代码]animation=[代码][代码]"{{containerAnimateData}}"[代码][代码]>[代码][代码] [代码][代码]<view class=[代码][代码]"x-modal-window"[代码][代码]>[代码][代码] [代码][代码]<view class=[代码][代码]"x-modal-header"[代码][代码]>[代码][代码] [代码][代码]<slot name=[代码][代码]"header"[代码][代码]></slot>[代码][代码] [代码][代码]</view>[代码][代码] [代码][代码]<view class=[代码][代码]"x-modal-content"[代码][代码]>[代码][代码] [代码][代码]<slot name=[代码][代码]"content"[代码][代码]></slot>[代码][代码] [代码][代码]</view>[代码][代码] [代码][代码]<view class=[代码][代码]"x-modal-footer flex"[代码][代码]>[代码][代码] [代码][代码]<view class=[代码][代码]'flex1 btn'[代码] [代码]bindtap=[代码][代码]"cancel"[代码][代码]>取消</view>[代码][代码] [代码][代码]<view class=[代码][代码]'flex1 btn'[代码] [代码]bindtap=[代码][代码]"success"[代码][代码]>确定</view>[代码][代码] [代码][代码]</view>[代码][代码] [代码][代码]</view>[代码][代码] [代码][代码]</view>[代码][代码]</view>[代码]然后每次visable改变时,想写动画但是都无法实现。 因为 [代码]observer[代码]是改变后才执行的。 有什么办法是让visable时执行的函数? 或者封装wx:if动画? [代码]Component({[代码][代码] [代码][代码]options: {[代码][代码] [代码][代码]multipleSlots: [代码][代码]true[代码] [代码]// 在组件定义时的选项中启用多slot支持[代码][代码] [代码][代码]},[代码][代码] [代码][代码]properties: {[代码][代码] [代码][代码]title: {[代码][代码] [代码][代码]type: String,[代码][代码] [代码][代码]},[代码][代码] [代码][代码]visable: {[代码][代码] [代码][代码]type: Boolean,[代码][代码] [代码][代码]value: [代码][代码]false[代码][代码],[代码][代码] [代码][代码]observer: [代码][代码]function[代码] [代码](newVal, oldVal) {[代码][代码] [代码][代码]var[代码] [代码]timer=1000;[代码][代码] [代码][代码]if[代码][代码](newVal){[代码][代码] [代码][代码]var[代码] [代码]mockAnimation = wx.createAnimation({[代码][代码] [代码][代码]duration: timer,[代码][代码] [代码][代码]timingFunction: [代码][代码]'ease'[代码][代码],[代码][代码] [代码][代码]});[代码][代码] [代码][代码]var[代码] [代码]containerAnimateData = wx.createAnimation({[代码][代码] [代码][代码]duration: timer,[代码][代码] [代码][代码]timingFunction: [代码][代码]'ease'[代码][代码],[代码][代码] [代码][代码]});[代码][代码] [代码][代码]this[代码][代码].mockAnimateData = mockAnimation;[代码][代码] [代码][代码]mockAnimation.opacity(1).step();[代码][代码] [代码][代码]containerAnimateData.top(0).step();[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]mockAnimateData: mockAnimation.export(),[代码][代码] [代码][代码]containerAnimateData: containerAnimateData[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码]else[代码][代码]{[代码][代码] [代码][代码]var[代码] [代码]mockAnimation = wx.createAnimation({[代码][代码] [代码][代码]duration: timer,[代码][代码] [代码][代码]timingFunction: [代码][代码]'ease'[代码][代码],[代码][代码] [代码][代码]});[代码][代码] [代码][代码]var[代码] [代码]containerAnimateData = wx.createAnimation({[代码][代码] [代码][代码]duration: timer,[代码][代码] [代码][代码]timingFunction: [代码][代码]'ease'[代码][代码],[代码][代码] [代码][代码]});[代码] [代码] [代码][代码]this[代码][代码].mockAnimateData = mockAnimation;[代码][代码] [代码][代码]mockAnimation.opacity(0).step();[代码][代码] [代码][代码]containerAnimateData.top([代码][代码]"-100%"[代码][代码]).step();[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]mockAnimateData: mockAnimation.export(),[代码][代码] [代码][代码]containerAnimateData: containerAnimateData.export()[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码] [代码] [代码][代码]}[代码][代码] [代码][代码]},[代码][代码] [代码][代码]},[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码] [代码][代码]},[代码][代码] [代码][代码]methods: {[代码][代码] ../[代码][代码] [代码][代码]}[代码][代码]})[代码]
2020-03-18