0
点赞
收藏
分享

微信扫一扫

微信小程序--19(.wxml 模板文件简单归纳)

小a草 2024-08-12 阅读 21
  • 类似HTML
  • 用来描述当前页面的结构

一、普通样式

1.<view> 内容 </view>

二、滚波样式

1.<swiper> 内容 </swiper>

2.<swiper-item>滚波内容 </swiper-item>

3.常用属性

  • 纵向:scroll-y
  • 横向:scroll-x
  • 圆点颜色:indicator-dots indicator-color
  • 圆点点击颜色:indicator-active-color
  • 自动滚动:autoplay
  • 滚动时间:interval
  • 链接滑动:circular

三、文本组件

1.text(普通)

  • <text> 内容 </text>
  • 常用属性
  • 长按选择文本
  • selectable

2.rich-text(富文本)

  • <rich-text> 内容 </rich-text>
  • 常用属性
  • 渲染为UI结构
  • nodes

四、按钮组件

1.button

  • <button> 内容 </button>

2.属性

  • 按钮颜色
  • type

  • 小尺寸
  • size

  • 镂空
  • plain

五、图片组件

1.image

  • <image> 内容 </image>

2.属性

  • 裁剪和缩放
  • mode

  • scaleToFill:默认值,不按比例来,填充满

  • aspectFit:纵横比缩放,保证长边显示出来

  • aspectFill:纵横比缩放,保证短边显示出来

  • widthFix:宽度不变,高度自动变化

  • heightFix:高度不变,宽度自动变化

举报

相关推荐

0 条评论