vue 响应式视频轮播
Vue轮播 (Vue Carousel)
A flexible, responsive, touch-friendly carousel for Vue.js.
适用于Vue.js的灵活,响应快速,触摸友好的轮播。
WARNING: vue-carousel is at pre-alpha stage of development and may undergo significant changes.
警告:vue轮播处于Alpha开发阶段,可能会发生重大变化。
安装 (Installation)
npm install -S vue-carousel
用法 (Usage)
全球 (Global)
You may install Vue Carousel globally:
您可以在全球范围内安装Vue Carousel:
import Vue from 'vue';
import VueCarousel from 'vue-carousel';
Vue.use(VueCarousel);
This will make <carousel> and <slide> available to all components within your Vue app.
这将使<carousel>和<slide>可用于Vue应用程序中的所有组件。
本地 (Local)
Include the carousel directly into your component using import:
使用import将轮播直接包含在您的组件中:
import { Carousel, Slide } from 'vue-carousel';
export default {
...
components: {
Carousel,
Slide
}
...
};
HTML结构 (HTML Structure)
Once the Carousel and Slide components are installed globally or imported, they can be used in templates in the following manner:
全局安装或导入Carousel和Slide组件后,可以按以下方式在模板中使用它们:
<carousel>
<slide>
Slide 1 Content
</slide>
<slide>
Slide 2 Content
</slide>
</carousel>
翻译自: https://vuejsexamples.com/a-flexible-responsive-touch-friendly-carousel-for-vue-js/
vue 响应式视频轮播