使用“Product Carouse”组件,您可以在Web应用程序上创建响应灵敏,适合移动设备的图库和图像轮播。
# NPM
$ npm install vue-product-carousel --save
1.安装并导入ProductCarousel
组件。
import ProductCarousel from 'vue-product-carousel'
2.在模板中使用ProductCarousel
组件。
<template>
<ProductCarousel :images="images">
Sidebar content here
</ProductCarousel>
</template>
<script>
3.激活轮播并用您自己的图像替换图像。
export default {
components: {
ProductCarousel,
},
data() {
images: [
'1.jpg',
'2.jpg',
'3.jpg',
]
},
}