赞
踩
- <template>
- <el-carousel :interval="4000" type="card" height="500px">
- <el-carousel-item v-for="item in tubox" :key="item.id">
- <img :src="item.tu" class="tu">
- <h3 class="medium">{{ item }}</h3>
- </el-carousel-item>
- </el-carousel>
- </template>
- <!-- 轮播图,从data拿到图片 -->
- <script>
- export default {
- data() {
- return {
- tubox: [
- { id: 0, tu: require("../assets/tu1.jpg") },
- { id: 1, tu: require("../assets/tu1.jpg") },
- { id: 2, tu: require("../assets/tu1.jpg") },
- { id: 3, tu: require("../assets/tu1.jpg") },
- { id: 4, tu: require("../assets/tu1.jpg") },
- { id: 5, tu: require("../assets/tu1.jpg") }
- ]
- }
- },
- methods: {
-
- }
- }
- </script>
- <style scoped>
- .el-carousel__item h3 {
- color: #475669;
- font-size: 14px;
- opacity: 0.75;
- line-height: 200px;
- margin: 0;
- }
-
- .el-carousel__item:nth-child(2n) {
- background-color: #99a9bf;
- }
-
- .el-carousel__item:nth-child(2n+1) {
- background-color: #d3dce6;
- }
- .tu {
- width: 100%;
- height: 100%;
- }
- </style>
elementui走马灯加入图片
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。