
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
@aidol/vue-carousel
Advanced tools
A carousel component for vue.js
Using npm
npm install @aidol/vue-carousel --save
# or
cnpm install @aidol/vue-carousel --save
In main.js
import Vue from 'vue'
import AiCarousel from '@aidol/vue-carousel'
Vue.use(AiCarousel)
// new Vue({ //...})
In_.vue
<ai-carousel :containerWidth="800" :containerHeight="300" :currWidth="400" :currHeight="280" :data="imgList" @jump="jumpTo" />
export default {
data(){
return {
imgList: [
{src: ""}
// ...
]
}
},
methods: {
jumpTo(info){
// `info` is the data which you setted before
// so something when you click current main img
}
}
}
属性 | 类型 | 说明 | 可选值 | 默认值 | 是否必需 |
---|---|---|---|---|---|
containerWidth | Number | 容器宽度 | - | 800 | 否 |
containerHeight | Number | 容器高度 | - | 300 | 否 |
currWidth | Number | 中间主图宽度 | - | 400 | 否 |
currHeight | Number | 中间主图高度 | - | 280 | 否 |
scale | Number | 两侧卡片缩放比例 | - | 0.8 | 否 |
autoplay | Boolean | 是否自动播放 | false | true | 否 |
interval | Number | 自动播放间隔毫秒数 | - | 3000 | 否 |
data | Array of object | 展示数据 | - | 本地演示数据 | 是 |
注:
data
props 为对象数组类型, 且每个对象中必须包含src
(图片地址) 属性。
[
{ src: 'http://www.example/a.png', alt: '图片加载出错了', title: '这是图片 title' },
{ src: 'http://www.example/b.png', alt: '图片加载出错了', title: '这是图片 title' },
{ src: 'http://www.example/c.png', alt: '图片加载出错了', title: '这是图片 title' }
// ...
]
图片的数据个数最好为 奇数,这样布局会比较协调。
@jump
点击主图时触发句柄
export default {
data(){
return {}
},
methods: {
jumpTo(info){
// `info` is the data which you setted before
// so something when you click current main img
}
}
}
2020/6/24 rebuild
2018/9/6 init
FAQs
A carousel component for vue.js
The npm package @aidol/vue-carousel receives a total of 0 weekly downloads. As such, @aidol/vue-carousel popularity was classified as not popular.
We found that @aidol/vue-carousel demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.