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-barousel

v1.0.3

Published

Vue, Carousel, Cool

Downloads

5

Readme

vue-barousel

网易云音乐同款 轮播图 组件

——简单易用

http://boenfu.cn/vue-barousel/demo.gif

demo: http://boenfu.cn/vue-barousel/demo.html

Install

npm install vue-barousel --save

Use

  1.Import 导入


// 方法1.通过use挂载
import VueBarousel from 'vue-barousel
Vue.use(VueBarousel)


//  方法2.通过require 导入
var VueBarousel = require('VueBarousel')



// 方法3.或者直接导入js文件
<script src="./dist/vue-barousel.js"></script>

  2.Usage 用法

<barousel :list="[{src: '图片路径', title: '图片title'}]"></barousel>

3.Options 配置项

| 选项名 | 是否必须 | 默认值 | 介绍 | | :--------: | :------: | :--------------: | :-------------------------------------------: | | :list | true | 无 | 选项数组{src: '图片路径', title: '图片title'} | | @barousel | false | 无 | 返回触发元素序号 | | :width | false | 100% | 容器宽度(默认父级100%) | | :height | false | 100% | 容器高度(默认父级100%) | | :arrow | false | true | 是否开启前后箭头 | | :imgType | false | full | 图片显示模式 | | :autoBegin | false | true | 是否自动播放 | | :mask | false | true | 前后图片遮罩 | | :interval | false | 5000 | 播放间隔 (ms) | | :tab | false | true | 是否开启底部导航 | | :color | false | rgb(248, 85, 85) | 底部 tab 激活时颜色 |

详细介绍:

  1. 数组格式如下

    [{
          title: '一张图片', //可选
          src: 'xx.jpg'  //图片地址
    }]

  2. imgType

    等同于 background-size

    可选项 full cover contain

    full 宽高皆为 100%

    cover 把背景图像扩展至足够大,以使背景图像完全覆盖背景区域。

    contain 把图像图像扩展至最大尺寸,以使其宽度和高度完全适应内容区域。

  3. barousel--> 回调函数

    解释:返回触发的序号,便于触发相应逻辑

    *数值参数均无需带单位

4.Develop 开发

进入 vue-barousel 目录

// 开发模式
npm run dev

// 打包
npm run build

Demo Code

<template>
  <div id="app">
    <barousel :list="setList()"
              :width="800"
              :height="280"
              :imgType="'full'"
              @barousel="cb">
    </barousel>
  </div>
</template>

<script>
export default {
  name: 'app',
  methods: {
    setList() {
      let list = [];
      for(let i =1 ; i<= 8;i++){
        list.push({
          title: i,
          src: 'static/img/'+i+'.jpg'
        })
      }
      return list;
    },
    cb (i) {
      alert(i);
    }
  }
}
</script>