uniapp 各种兼容,优化等问题记录

  • 对于ios自带的上下拉-进行禁用-橡皮筋回弹

1.pages.json中加入如下配置
{
        "path": "pages/my/my",
        "style": {
            "navigationBarTitleText": "个人中心",
            "disableScroll": true,//禁止滑动
            "enablePullDownRefresh": false,
            "navigationBarTextStyle": "white",
            "navigationStyle": "custom",
            "navigationBarBackgroundColor": "#4095E5"
        }
    }
2.页面中如果需要滚动 加入scroll-view组件
<scroll-view scroll-y="true" class="scontent" :enhanced="true" :bounces="false" :show-scrollbar="false">
</scroll-view>
<style>
    .content{
        //可视高度,需要在多大的盒子中进行滑动
        height: 100vh;
        width: 100%;//视情况设置
    }
</style>
  • rich-text富文本图片之间有空白-富文本全是图片并且需要去掉空白处理

1.font-size: 0;时文字内容会全部不显示
<rich-text :nodes="data.content" :style="flag?'font-size: 0;':''"></rich-text>
2.使用标识font; 选择去不去除空白
if (res.content.indexOf('font;') != -1) {
    this.flag = true;//去除图片空白,此时所有文字不会显示
    //res.content = res.content.replace("font;", "");//标识去除,不显示文字,所以不需要替换去除
}
this.data = res
  • 去除button所有默认样式

.buttonClear {
        color: #333;
        text-align: center;
        border: none;
        border-radius: 0;
        background-color: transparent;
        display: flex;
        padding: 0px;
        magin: 0px;
    }

    .buttonClear::after {
        border: none;
    }
  • 点击放大

.carpush:active {
        transform: scale(1.8);
    }
  • 弹跳


<uni-grid :column="5" :show-border="false" :square="false">
    <uni-grid-item v-for="(item ,index) in classList" :index="index" :key="index">
        <view class="grid-item-box" @click="clickClass(item.id)">
            <image class="image" :src="item.icon" mode="aspectFill" />
            <text class="text">{{item.title}}</text>
            <!-- <view v-if="item.badge" class="grid-dot">
            <uni-badge :text="item.badge" :type="item.type" />
        </view> -->
        </view>
    </uni-grid-item>
</uni-grid>


<style lang="scss">
.image {
    width: 57px;
    height: 57px;
    position: relative;
    animation: myfirst 2s;
    /* Safari and Chrome */
    -webkit-animation: myfirst 2s;
}
@keyframes myfirst {
    10% {
        left: 0px;
        top: 0px;
    }

    40% {
        left: 0px;
        top: -20px;
    }

    45% {
        left: 0px;
        top: 0px;
    }

    65% {
        left: 0px;
        top: -8px;
    }

    70% {
        left: 0px;
        top: 0px;
    }

    80% {
        left: 0px;
        top: -2px;
    }

    90% {
        left: 0px;
        top: 0px;
    }
}

@-webkit-keyframes myfirst {
    10% {
        left: 0px;
        top: 0px;
    }

    40% {
        left: 0px;
        top: -20px;
    }

    45% {
        left: 0px;
        top: 0px;
    }

    65% {
        left: 0px;
        top: -8px;
    }

    70% {
        left: 0px;
        top: 0px;
    }

    80% {
        left: 0px;
        top: -2px;
    }

    90% {
        left: 0px;
        top: 0px;
    }
}
</style>
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

浮生若梦l

你的鼓励实我创作最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值