微信小程序,skyline引擎,display: grid失效问题解决

为了所谓的性能和自定义导航栏,选择使用skyline引擎,但它似乎对 display: grid支持的并不好,尝试了很多方法都不行,效果不理想(如果你有更好的方法,方便的话请分享给我一份,万分感谢)

最后没办法,直接用了官方推荐的grid-view,但grid-view不能拿来直接用,它需要在外层再套个scroll-view,以下代码实现了每行显示3个,但仍然有一个问题,就是它外层的scroll-view必须指定具体的高度,所以在不知道具体高度,或者不好设置固定高度的情况下,仍然还需要上其他手段,比如给scroll-view加scroll-y/scroll-x滚动条,或直接上js代码获取grid-view的尺寸,然后动态更新scroll-view的高度(我猜可以,没测试)。

html 复制代码
        <scroll-view type="custom" style="height: 240rpx;">
          <grid-view type="aligned" main-axis-gap="10" cross-axis-gap="10" cross-axis-count="3">
            <view class="grid-item" hover-class="hover-feedback-scale" bindtap="goToQuickService" data-service="duty-profile">
              <text class="grid-icon">📋</text>
              <text class="grid-name">个人档案</text>
            </view>
            <view class="grid-item" hover-class="hover-feedback-scale" bindtap="goToQuickService" data-service="duty-task">
              <text class="grid-icon">🔔</text>
              <text class="grid-name">任务提醒</text>
            </view>
            <view class="grid-item" hover-class="hover-feedback-scale" bindtap="goToQuickService" data-service="duty-checkin">
              <text class="grid-icon">✅</text>
              <text class="grid-name">签到打卡</text>
            </view>
            <view class="grid-item" hover-class="hover-feedback-scale" bindtap="goToQuickService" data-service="proposal-submit">
              <text class="grid-icon">📝</text>
              <text class="grid-name">提交议案</text>
            </view>
            <view class="grid-item" hover-class="hover-feedback-scale" bindtap="goToQuickService" data-service="proposal-query">
              <text class="grid-icon">📊</text>
              <text class="grid-name">进度查询</text>
            </view>
            <view class="grid-item" hover-class="hover-feedback-scale" bindtap="goToQuickService" data-service="internal">
              <text class="grid-icon">🔒</text>
              <text class="grid-name">内部交互</text>
            </view>
          </grid-view>
        </scroll-view>
相关推荐
AI品信智慧数智人1 小时前
从键盘打字到语音对话✨数字人交互重塑小程序用户体验新范式
小程序
爱勇宝16 小时前
上线 20 多天后,我才发现小程序的图片上传一直不可用
微信小程序·智能小程序
2601_9567436818 小时前
上海小程序开发公司:本地优质厂商名录与源码私有化技术分析
小程序·开发经验·上海
科技小刘c1 天前
接单做小程序,我算了笔省下的时间账
小程序
老大白菜1 天前
Omnigent(omni)使用说明
服务器·数据库·microsoft
2501_916008892 天前
苹果上架工具怎么选 不用 Mac 上架 App Store 的几种方案
android·macos·ios·小程序·uni-app·iphone·webview
hkj88082 天前
Linux 总线-设备-驱动(Bus-Device-Driver)完整协作原理
linux·运维·microsoft
万亿少女的梦1682 天前
基于微信小程序、Spring Boot与Vue3的智慧养老管理系统设计与实现
spring boot·redis·微信小程序·mybatis·vue3
万岳科技系统开发2 天前
智慧医院小程序开发满足医疗机构多场景服务需求
数据库·学习·小程序
facaixxx20242 天前
AI模型的Function Calling能力:工作原理及模型支持清单
microsoft