🏆 Top Story: .html - Hot Topic
  • 产品分类
  • 联系我们
    成颂信息科技有限公司
    联 系 人:赵经理
    移动电话: 15338521262
    固定电话:17310736913
    通讯地址:北京市顺义区66号
  • 微信小程序纵向布局

    微信小程序纵向布局

    微信小程序纵向(xiang)布局可(ke)通过设置flex-direction为column实现,微信同时使用flex属性控制子元素的小程序纵向布大小和位(wei)置。

    微信小程序
    扩展组件(jian)·纵向选项卡组(zu)件(jian)

    微信小程序作为一款轻量级的微信应用,其功能丰富且易于开发,小程(cheng)序纵向布在微信小程序中,微信我们可以使用各种扩展组件来丰富应用(yong)的小程序纵向布功能,本文将介绍一种常用的微信扩展组件(jian)——纵向选项卡组件。

    微信小程序纵向布局

    微信小程序纵向布局

    纵向(xiang)选项卡组件简介

    纵向选项卡组件是小程序纵向布一种(zhong)常见的UI组件,它可以在一个页面中展示多个(ge)选项,微信用户可以通(tong)过点击不同的小(xiao)程序纵向(xiang)布选项切换到不同的页面或内容,这种组件通常用于展示(shi)多个相关的微信内容,方便用户快速浏览和选择。小程序纵向布(bu)

    微信小程序纵向布局

    纵向选项卡组件的(de)微信使用方法(fa)

    1、在小程序的小程序纵向(xiang)布app.json文件中,添加"usingComponents"字段,微信声明要使用的纵向选项卡组件:

    {  "usingComponents": {  "vantabs": "path/to/vantweapp/dist/tabs/index" }}

    2、在(zai)需要使用纵向选项卡组件的页面的(de)json文件中,引入组(zu)件(jian):

    {  "usingComponents": {  "vantab": "path/to/vantweapp/dist/tabs/index" }}

    3、在页面的(de)wxml文件中,添加纵向选项卡组(zu)件:

    <vantabs> <vantab title="标签1">内(nei)容1</vantab> <vantab title="标签2">内容(rong)2</vantab> <vantab title="标签3">内(nei)容3</vantab></vantabs>

    纵向(xiang)选项卡组件的属性和方法

    1、属性:

    属性名 类型
    默认值
    说明
    active Number 0 当前激活的标签索引,从0开始
    animated
    Boolean true 是否开启动画效果
    duration Number 300
    动画时长(chang),单位为毫秒
    color String #999999 标题颜色
    fontSize
    Number 14 标题字体大小
    backgroundColor String #ffffff 背景颜色
    borderStyle String solid 边框样式
    borderColor String #eeeeee 边框颜色
    lineHeight Number 50 行高,单位为rpx
    radius Number 8 圆角大小,单位(wei)为(wei)rpx
    scrollable Boolean false 是否开启滚动条
    lazyLoad Boolean false 是否开启懒加载
    showIndicator Boolean true 是否显示指示(shi)器
    leftIconColor String #999999 左侧图标颜色(仅适用于自定义图标)
    rightIconColor String #999999 右侧图标(biao)颜色(仅适用于自定义图标)
    fixedColor String #1aad19 固定态的颜色(仅适用于自定义图标)
    activeColor
    String
    #1aad19 激活态的颜色(仅适用于自定义图标)
    disabled="disabled"Color String #cccccc 禁用态的颜色(仅适用(yong)于自定义图标)
    fontWeight String
    normal
    标题字体粗细,可选值为normal、bold、bolder、lighter、100、200、300、400、500、600、700、800、900、inherit等
    fontStyle String normal 标题字体样式,可选值为normal、italic、oblique等
    textAlign
    String
    center 标题对齐方式,可选值为(wei)left、center、right等

    | customIconsLeft / customIconsRight / customIconsTop / customIconsBottom / customIconsInactiveText / customIconsActiveText / customIconsInactiveColor / customIconsActiveColor / customIconsInactiveSize / customIconsActiveSize / customIconsInactiveFontFamily / customIconsActiveFontFamily / customIconsInactiveLineHeight / customIconsActiveLineHeight / customIconsInactiveFontWeight / customIconsActiveFontWeight / customIconsInactiveFontStyle / customIconsActiveFontStyle (仅适用(yong)于自定义图(tu)标) Custom icons for the tab bar, can be set individually for each tab. These properties are only valid when using the custom type of tab. For more information, please refer to the official documentation.

    | zIndex Number The zindex of the tab bar, default is auto. This property is only valid when using the custom type of tab. For more information, please refer to the official documentation.

    | safeAreaInsetBottom Number The bottom inset of the safe area, default is auto. This property is only valid when using the custom type of tab. For more information, please refer to the official documentation.

    | safeAreaInsetTop Number The top inset of the safe area, default is auto. This property is only valid when using the custom type of tab. For more information, please refer to the official documentation.

    | safeAreaInsetLeft Number The left inset of the safe area, default is auto. This property is only valid when using the custom type of tab. For more information, please refer to the official documentation.

    | safeAreaInsetRight Number The right inset of the safe area, default is auto. This property is only valid when using the custom type of tab. For more information, please refer to the official documentation.

    | safeAreaBackgroundColor Color The background color of the safe area, default is transparent. This property is only valid when using the custom type of tab. For more information, please refer to the official documentation.

    | safeAreaBackgroundImage Image The background image of the safe area, default is none. This property is only valid when using the custom type of tab. For more information, please refer to the official documentation.

    | safeAreaCustomBackgroundColor Color The background color of the safe area when it overlaps with the content, default is transparent. This property is only valid when using the custom type of tab. For more information, please refer to the official documentation.

    | safeAreaCustomBackgroundImage Image The background image of the safe area when it overlaps with the content, default is none. This property是纵向选项卡组件的使用方法,在小程序的app.json文件中(zhong),添加"usingComponents"字段,声明要使用的纵向选项卡组件:
    <

    “`json

    {

    "usingComponents": {

    "vantabs": "path/to/vantweapp/dist/tabs/index"

    }

    }

    “`

    在需要使用纵向(xiang)选项卡组件的页面的json文件中,引入(ru)组件:

    “`json

    {

    "usingComponents": {

    "vantab": "path/to/vantweapp/dist/tabs/index"

    }

    }

    “`

    在页面的wxml文件中(zhong),添加纵向选项卡组件:

    “`html

    <vantabs>

    <vantab title="标签1">内(nei)容1</vantab>

    <vantab title="标签2">内容2</vantab>

    <vantab title="标签3">内容(rong)3</vantab>

    </vantabs>

    “`

    纵向选项卡组件的属性和方法

    1、属性:

    | 属性名 | 类型 | 默认值 | 说明(ming) |

    ||||

    | active | Number | 当前激活(huo)的(de)标(biao)签索引,从0开始 | 当前激活(huo)的标签索引,从0开始 |

    | animated | Boolean | true | true表示开启动画效果,false表示关(guan)闭动画效果 |

    | duration | Number | 300 | animationDuration属性指定动画时长,单位为ms |

    | color | String | #999999 | title文字颜色 |

    | fontSize | Number | 14 | title文字大小(xiao)


  • 成颂信息科技有限公司
    通讯地址:上海市虹口66号    联系人:
    赵经理
        联系电话:17717464068