Socket
Socket
Sign inDemoInstall

miniprogram-slide-tabs

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

miniprogram-slide-tabs

> 类似可滑动的新闻菜单栏,支持tab栏点击自动滑动到视图区以及内容区侧滑


Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

slide-tabs

类似可滑动的新闻菜单栏,支持tab栏点击自动滑动到视图区以及内容区侧滑

slide-tabs

加入项目

  • npm下载
npm i -S miniprogram-slide-tabs

使用

{
  "usingComponents": {
    "slide-tabs": "wx-slide-tabs"
  }
}
  • 手动下载组件到项目components目录 使用
{
  "usingComponents": {
    "slide-tabs": "/components/wx-slide-tabs/index"
  }
}

使用

wxml(slot为slide-tab-(下标+1))

<slide-tabs tabs="{{['首页', '开发管理']}}" slidable="{{ false }}" loop="{{true}}" bind:change="onChange" >
  <view slot="slide-tab-1">h1</view>
  <view slot="slide-tab-2">h2</view>
  <view slot="slide-tab-3">h3</view>
</slide-tabs>

js

Page({
	onChange: function(e) {
		console.log(e)
	}
})

参数

选项名类型是否必填默认值描述
tabsArrayfalse[]tab栏标题数组['首页', '开发管理']或者[{title: '首页'}, {title: '开发关注'}]
tabheightNumberfalse96单位为rpx
heightNumberfalse整个组件高度默认视窗高度,单位为rpx
loopBooleanfalsefalse内容区是否衔接滑动,即从最后一栏右滑置第一栏,第一栏左滑至最后一栏
slidableBooleanfalsefalsetabs栏是否滑动,默认为false,内容平分宽度

事件

选项名类型是否必填描述
bind:changeFunctionfalse监听点击/切换事件

注意事项

  如果在某些场景下,当参数slide为true,tabs出现滚动的时候,出现了滚动条,可以在引入组件的页面或特定标签中添加如下样式隐藏滚动条

::-webkit-scrollbar {
	width: 0;
	height: 0;
	color: transparent;
}

其他小程序插件

  • wx-city-picker:小程序城市选择器, 省市区三级联动

FAQs

Package last updated on 10 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc