安装vue2.0中vue-easy-slider的滑块组件插件
安装 npm i -S vue-easy-sliderdemo1:<template><slider animation="fade"><slider-item v-for="(i, index) in list" :key="index"><
·
安装 npm i -S vue-easy-slider
demo1:
<template>
<slider animation="fade">
<slider-item v-for="(i, index) in list" :key="index">
<div :style="i">
<p style="line-height: 280px; font-size: 5rem; text-align: center;">Page{{ index + 1 }}</p>
</div>
</slider-item>
</slider>
</template>
<script>
import { Slider, SliderItem } from 'vue-easy-slider'
export default{
data :function() {
return {
list: [
{ backgroundColor: '#3f51b5', width: '100%', height: '100%' },
{ backgroundColor: '#eee', width: '100%', height: '100%' },
{ backgroundColor: '#f44336', width: '100%', height: '100%' },
],
}
},
components: {
Slider,
SliderItem
}
}
</script>
<style>
</style>
效果:
更多推荐
已为社区贡献5条内容
所有评论(0)