npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-tabslider

v1.0.1

Published

A Vue.js project

Downloads

12

Readme

vue-tabslider vue tab滑动切换插件

vue-tabslider

NPM version

npm


# npm install
npm install vue-tabslider --save

引入

在main.js中引入

import vueTabslider from './index.js'
Vue.use(vueTabslider)

使用

vue tab滑动插件

  • 使用时需要给vue-tabslider设置一个宽度和高度
  <vue-tabslider
      :duration="300"
      :position="'top'"
      :title="titleData"
      :titleStyles="titleStyles"
      :activeStyle="activeStyle"
      :titleBoxStyles="titleBoxStyles"
        style="width:100vw;height:100vh;">
  </vue-tabslider>

| 参数 | 类型 | 备注 | 默认值 | 是否必须 | ------ | ------ | ------ | ------ | ------ | | duration | Number | 动画过渡时间 | 300 | false | | position | String | tab标题位置 | 'top' | false | | title | Array | 标题数组 | [{ name: '我的' }] | false | | titleStyles | Object | 标题样式(驼峰命名:backgroundColor) | {} | false | | activeStyle | Object | 标题激活样式(驼峰命名:backgroundColor) | {} | false | | titleBoxStyles | Object | 滑动页样式(驼峰命名:backgroundColor) | {} | false |

使用自定义插槽

  • 在组件中添加template
  • 添加div,class为tab-slider
  <vue-tabslider
      :duration="300"
      :position="'top'"
      :title="titleData"
      :titleStyles="titleStyles"
      :activeStyle="activeStyle"
      :titleBoxStyles="titleBoxStyles"
        style="width:100vw;height:100vh;">
    <template>
      <div class="tab-slider" style="background:#fde1e1">
        first
      </div>
      <div class="tab-slider" style="background:#b2c0f1">
        second
      </div>
      <div class="tab-slider" style="background:#e6f5ea">
        third
      </div>
      <div class="tab-slider" style="background:#e6d3f5">
        four
      </div>
    </template>
  </vue-tabslider>

属性举例

// 标题数组
title: [
  {
    name: '首页'
  },
  {
    name: '数据页'
  },
  {
    name: '我的'
  },
  {
    name: '更多'
  }
],
// 标题样式属性
titleStyles: {
  borderRight: '1px solid #333'
},
// 滑动页样式属性
titleBoxStyles: {
  paddingLeft: '1px',
  background: '#FFFFFF',
  width: '100%'
},
// 标题激活样式属性
activeStyle: {
  color: '#745fe4',
  fontSize: '30px'
}

效果展示

avatar

源码地址:https://github.com/liqin1059/vue-tabslider