element-plus/docs/examples/carousel/vertical.vue
热爱vue的小菜鸟 cd306117ae
feat(components): [carousel] If the carousel height is auto apply item height (#12388)
* fix(components): [carousel] :height is auto and card direction  vertical

* fix(components): [carousel] :height is auto and card direction vertical

* fix(components): [carousel] :height is auto and card direction 垂直

* feat(components): [carousel] height is adaptive when height is auto

* feat(components): [carousel] height is adaptive when height is auto

* fix(components): [carousel] :height is auto and card direction 垂直

* fix(components): [carousel] :height is auto and card direction 垂直

* fix(components): [carousel] :height is auto  test.tsx

* fix(components): [carousel] :height is auto and card direction

* fix: delete zIndex

* fix: delete ts type

* fix: add test

* fix: css modification

* fix: delete doc inside

* fix: Revise card width not adaptive

* fix: Modify calcCardTranslate

* fix: test

* fix: calcCardTranslate

* fix: remove redundant code
2023-05-14 17:47:43 +08:00

38 lines
901 B
Vue

<template>
<p class="text-center demonstration">normal vertical layout</p>
<el-carousel height="200px" direction="vertical" :autoplay="false">
<el-carousel-item v-for="item in 4" :key="item">
<h3 text="2xl" justify="center">{{ item }}</h3>
</el-carousel-item>
</el-carousel>
<p class="text-center demonstration">card vertical layout</p>
<el-carousel
height="400px"
direction="vertical"
type="card"
:autoplay="false"
>
<el-carousel-item v-for="item in 4" :key="item">
<h3 text="2xl" justify="center">{{ item }}</h3>
</el-carousel-item>
</el-carousel>
</template>
<style scoped>
.el-carousel__item h3 {
color: #475669;
opacity: 0.75;
line-height: 200px;
margin: 0;
text-align: center;
}
.el-carousel__item:nth-child(2n) {
background-color: #99a9bf;
}
.el-carousel__item:nth-child(2n + 1) {
background-color: #d3dce6;
}
</style>