当前位置: 首页 > news >正文

企业网站的基本内容不受国内限制的浏览器下载

企业网站的基本内容,不受国内限制的浏览器下载,番禺网站制作,石家庄做网站电话recycle-view是微信小程序官方推出的一个经过优化的长列表组件,但是在使用百分比单位控制高宽时有个内容溢出问题,虽然它提供了height和width的参数可以设置宽高,但每次写列表都需要去js里获取宽高并设置是较为麻烦的,所以现在来着…

recycle-view是微信小程序官方推出的一个经过优化的长列表组件,但是在使用百分比单位控制高宽时有个内容溢出问题,虽然它提供了height和width的参数可以设置宽高,但每次写列表都需要去js里获取宽高并设置是较为麻烦的,所以现在来着手解决使用百分比单位设置宽度时碰到的内容溢出问题。

先看看问题怎么复现:

1.先添加组件依赖:

{"usingComponents": {"recycle-view": "miniprogram-recycle-view/recycle-view","recycle-item": "miniprogram-recycle-view/recycle-item"}
}

2.编写wxml:

<view id="root" style="height: 100%;"><view style="height:50%;width: 100%;background-color: blue;"><recycle-view batch="{{batchSetRecycleData}}" id="recycleId"><recycle-item wx:for="{{1000}}" wx:key="id"><view style="width: 100px;height: 100px;">1234</view></recycle-item></recycle-view></view>
</view>

wxss:

page {width: 100%;height: 100%;
}

3.查看界面

4.现在来说一下问题,首先是界面显示了一个基于recycleview的列表,然后他的父元素我给他设置了height:50%,按理来说这个列表的区域也应该是Page内容区域高度的50%,也就是和蓝色区域重合,但是他现在内容溢出了

这明显是不合理的,接下来是修复

1.打开miniprogram_npm/miniprogram-recycle-view/recycle-view.wxml,编辑最外层的view的style,直接改为height:100%;width:100%

<!--components/recycle-view/recycle-view.wxml-->
<view bindtouchstart='_beginToScroll' style="height:100%;width:100%;" id="content" class="wrap"><scroll-view bindscroll="_scrollViewDidScroll" class="content" style='height:100%;position: relative;' scroll-y="{{useInPage ? false : scrollY}}" scroll-x="{{false}}" upper-threshold="{{upperThreshold}}" lower-threshold="{{lowerThreshold}}" scroll-top="{{innerScrollTop}}" scroll-into-view="{{innerScrollIntoView}}" scroll-with-animation="{{scrollWithAnimation}}" bindscrolltoupper="_scrollToUpper" bindscrolltolower="_scrollToLower" scroll-anchoring enable-back-to-top="{{enableBackToTop}}" throttle="{{throttle}}"><view style="position: absolute;z-index:1;width:100%;left: 0;top: 0;opacity: 0;visibility: hidden;"><slot name="itemsize"></slot></view><view style="height:{{hasBeforeSlotHeight ? beforeSlotHeight + 'px' : 'auto'}}" class="slot-before"><slot name="before"></slot></view><view style='position:relative;width:100%;z-index:10;background: url("{{placeholderImageStr}}") repeat;height:{{totalHeight}}px;'><!-- <view class='before' style="height:{{innerBeforeHeight}}px"></view> --><view style="position: absolute;left:0;width:100%;top:{{innerBeforeHeight}}px;"><slot></slot></view><!-- <view class='after' style="height:{{innerAfterHeight}}px"></view> --></view><view style="height:{{hasAfterSlotHeight ? afterSlotHeight + 'px' : 'auto'}}" class="slot-after"><slot name="after"></slot></view></scroll-view>
</view>

2.打开miniprogram_npm/miniprogram-recycle-view/recycle-view.wxss,将:host{}删除或者注释

/* components/recycle-view/recycle-view.wxss */
/* :host {display: block;width: 100%;
} */

3.运行看看效果:

内容不溢出了,而且滚动效果也正常。

微信小程序代码片段(需要手动安装recycleview依赖):https://developers.weixin.qq.com/s/J3TFLYmQ71K1

http://www.yidumall.com/news/66503.html

相关文章:

  • 做网站用什么语言制作最安全网络营销ppt怎么做
  • 上海建设局官方网站合肥网络公司
  • 网站建设任务平台南京百度seo排名
  • 怎样做网站收广告费持续优化完善防控措施
  • 网站备案期间如何最近新闻热点大事件
  • 美国虚拟地址生成器seo培训网的优点是
  • 佛山网站制作专家19
  • 模仿网站网站推广网站
  • 中企动力全网门户网站万词优化
  • 晋江网站建设价格长沙seo
  • wordpress cm惠州seo招聘
  • 网站开发后台技术爱站网关键词查询网站
  • 网站建设案例分析长沙网站优化排名推广
  • 如何学好网站开发百度图片搜索网页版
  • 网站开发团队名字5118大数据平台官网
  • 中国建设委员会官方网站长沙官网seo技术
  • 做网站选什么系统域名被墙检测
  • 外贸网站建设注意事项关键词优化软件有哪些
  • 广州网站建设公司哪个好广州最新政策
  • 利用博客做网站排名百度广告
  • 上海专业网站建设咨询网络营销与直播电商怎么样
  • .ai域名注册网站谷歌seo课程
  • 网站建设合同技术开发合同外链优化
  • 重庆汉沙科技做网站怎么样发帖推广百度首页
  • 做网站优化的关键词怎么设置品牌营销策划案例
  • 系统官网网站模板下载安装淘宝指数转换工具
  • 无锡专业做网站公司找回今日头条
  • 未备案的网站可以百度推广吗网络营销是什么专业
  • 做衬衫的网站app推广实名认证接单平台
  • 网站开发主要用到哪些工具seo零基础视频教程