UINAPP 遇到bug合集.....持续更新

1.不支持动态具名插槽

        注意 微信小程序 动态插槽不支持默认内容

//子组件
<template v-for="(item, index) in tabItem">
      <view class="flex-grow h-0 overflow-auto" v-if="computedValue === item.name" :key="index">
        <!-- #ifdef MP -->
        <!-- <slot name="{{item.name}}"> </slot> -->
        <slot name="tab:{{index}}"> </slot>
        <!-- #endif -->

        <!-- #ifdef H5 || APP-PLUS  -->
        <!-- <slot :name="item.name"> -->
        <slot :name="`tab:${index}`">
          <view class="w-full h-80 flex-center">
            <text class="text-c_gray-2">暂无数据{{ item.name }}</text>
          </view>
        </slot>
        <!-- #endif -->
      </view>
</template>

//父组件
 <!-- #ifdef MP -->
      <template v-for="(item, index) in tabItem" slot="tab:{{index}}">
 <!-- #endif  -->
<!-- #ifdef H5  || APP-PLUS   -->
      <template v-for="(item, index) in tabItem" :slot="`tab:${index}`">
<!-- #endif -->

2.打包后的App容易出现undefined

小程序和H5 中data中定义的字段,不会显示undefined

在app中会在页面中显示undefined,并且影响报错,程序被堵塞,后面的内容无法被渲染

解决办法:

//1.data中初始化变量
js: data(){
        return {
            obj:{
            user:{userInfo:{}}
            }
        }
    }
    
//2.标签上加上判断
<view v-if="obj && obj.user && obj.user.userInfo">{{obj.user.userInfo}}</view>

3.属性名不能使用dataXxxx或者data-xxx

因为微信向程序自定义属性,不能使用驼峰命名法

因为dataXxx 格式化后会变成data-xxx 是H5的属性命名

在解析 data-xxx命名时, 在js中获取的时候会将驼峰的写法转化成纯小写e.currentTarget.dataset.xxxx

4.H5 跳转到小程序

dd.biz.util.openLink()

5.app不支持css3动画

H5 可以使用css3都动画

解决ios系统的BUG

ios系统上,动画一旦开始,就不能修改了。那可以把动画停止,再修改开启动画。

但不是直接把动画时间改为0,而是使用css动画的一个属性:

anmation-play-state:paused|running;

transform不兼容

可以使用兼容语法

 <!-- #ifdef H5 || MP-->
          <span
            class="iconfont u-server-icon iconjinrujiantou"
            :class="[isCollapseShow ? 'deg1' : 'deg2']"
          />
 <!--#endif-->
 <!-- #ifdef APP-PLUS-->
  <span v-if="isCollapseShow" class="iconfont u-server-icon iconxialajiantou"/>
  <span v-else class="iconfont u-server-icon iconjinrujiantou"/>
 <!--#endif-->

.....持续更新

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值