New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

fun-tab

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fun-tab

A mobile touch-swappable tabs component for Vue3

latest
Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
10
42.86%
Maintainers
1
Weekly downloads
 
Created
Source

fun-tab

ly-tab的 Vue3 版本,更名为 fun-tab。

基本效果展示

v3 0 0

安装

pnpm add fun-tab
# or
yarn add fun-tab
# or
npm i fun-tab

使用

全局注册

import { createApp } from 'vue'
import FunTab from 'fun-tab'
import 'fun-tab/dist/index.css'
import App from './App.vue'

const app = createApp(App)

app.use(FunTab)

app.mount('#app')

局部注册

<script setup>
import { FunTabs, FunTabBar, FunTabItem } from 'fun-tab';

// ...
</script>

FunTabs

简易示例

<fun-tabs v-model="value">
  <fun-tab-item name="1" title="选项卡1" />
  <fun-tab-item name="2" title="选项卡2" />
</fun-tabs>
<script setup>
import { ref } from 'vue'

const value = ref('1')
</script>

属性

属性说明类型默认值
modelValue当前激活的 tab 的 name 属性值string | number''
lineWidth当前激活 tab 下划线的宽度,单位 px,为auto时表示当前激活 tab 项的宽度number | string30
lineHeight当前激活 tab 下划线的高度,单位 pxnumber3
activeColor激活状态下 tab 文案及下划线的颜色string#1677ff
additionalX近似等于超出边界时最大可拖动距离,单位 pxnumber50
reBoundExponent惯性回弹指数,值越大,惯性回弹距离越长number10
inertialDuration惯性滑动过程的持续时间,值越小,感知上阻力越大,可近似认为惯性滑动过程速度减为零所需的时间(ms)number1000
reBoundingDuration回弹过程动画duration,单位 msnumber360

事件

事件名说明回调参数
update:modelValue切换激活 tab 项的回调name: string | number
change切换激活 tab 项的回调name: string | number

方法

方法名说明参数返回值
resize外层元素大小或组件布局、尺寸变化时,可以调用此方法来进行重绘--

插槽

名称说明
default默认插槽,放置 FunTabItem 组件

FunTabItem

属性

属性说明类型默认值
title选项卡显示文字string-
name选项卡标识符string | number选项卡索引
badge右上角徽标内容string | number-

插槽

名称说明
default选项卡文字内容插槽,优先级高于传入的 title 属性
icon选项卡图标

FunTabBar

简易示例

<fun-tab-bar v-model="value">
  <fun-tab-item name="1" title="选项卡1" />
  <fun-tab-item name="2" title="选项卡2" />
</fun-tab-bar>
<script setup>
import { ref } from 'vue'

const value = ref('1')
</script>

属性

属性说明类型默认值
modelValue当前激活的 tab 的 name 属性值string | number''
activeColor激活状态下 tab 文案及icon的颜色string#1677ff

事件

事件名说明回调参数
update:modelValue切换激活 tab 项的回调name: string | number
change切换激活 tab 项的回调name: string | number

插槽

名称说明
default默认插槽,放置 FunTabItem 组件

Keywords

Vue

FAQs

Package last updated on 21 May 2022

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