-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
gang.yang
committed
Feb 22, 2022
1 parent
c1c22cc
commit 4bc7019
Showing
7 changed files
with
138 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<markdown> | ||
# Set aspect ratio | ||
|
||
When the `effect` property is `card`, you can customize the aspect ratio of the main card and the front and rear cards. | ||
|
||
</markdown> | ||
|
||
<template> | ||
<n-carousel | ||
effect="card" | ||
:centered-slides="true" | ||
:scale="[1, 1.2]" | ||
style="height: 240px" | ||
> | ||
<n-carousel-item :style="{ width: '60%' }"> | ||
<img | ||
class="carousel-img" | ||
src="https://naive-ui.oss-cn-beijing.aliyuncs.com/carousel-img/carousel1.jpeg" | ||
> | ||
</n-carousel-item> | ||
<n-carousel-item :style="{ width: '60%' }"> | ||
<img | ||
class="carousel-img" | ||
src="https://naive-ui.oss-cn-beijing.aliyuncs.com/carousel-img/carousel2.jpeg" | ||
> | ||
</n-carousel-item> | ||
<n-carousel-item :style="{ width: '60%' }"> | ||
<img | ||
class="carousel-img" | ||
src="https://naive-ui.oss-cn-beijing.aliyuncs.com/carousel-img/carousel3.jpeg" | ||
> | ||
</n-carousel-item> | ||
<n-carousel-item :style="{ width: '60%' }"> | ||
<img | ||
class="carousel-img" | ||
src="https://naive-ui.oss-cn-beijing.aliyuncs.com/carousel-img/carousel4.jpeg" | ||
> | ||
</n-carousel-item> | ||
</n-carousel> | ||
</template> | ||
|
||
<style> | ||
.carousel-img { | ||
margin: 0 auto; | ||
width: 100%; | ||
height: 100%; | ||
object-fit: cover; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<markdown> | ||
# 设置高宽比 | ||
|
||
当`effect`属性为`card`时,你可以自定义,主card和前后两个card的高宽比。 | ||
|
||
</markdown> | ||
|
||
<template> | ||
<n-carousel | ||
effect="card" | ||
:centered-slides="true" | ||
:scale="[1, 1.2]" | ||
style="height: 240px" | ||
> | ||
<n-carousel-item :style="{ width: '60%' }"> | ||
<img | ||
class="carousel-img" | ||
src="https://naive-ui.oss-cn-beijing.aliyuncs.com/carousel-img/carousel1.jpeg" | ||
> | ||
</n-carousel-item> | ||
<n-carousel-item :style="{ width: '60%' }"> | ||
<img | ||
class="carousel-img" | ||
src="https://naive-ui.oss-cn-beijing.aliyuncs.com/carousel-img/carousel2.jpeg" | ||
> | ||
</n-carousel-item> | ||
<n-carousel-item :style="{ width: '60%' }"> | ||
<img | ||
class="carousel-img" | ||
src="https://naive-ui.oss-cn-beijing.aliyuncs.com/carousel-img/carousel3.jpeg" | ||
> | ||
</n-carousel-item> | ||
<n-carousel-item :style="{ width: '60%' }"> | ||
<img | ||
class="carousel-img" | ||
src="https://naive-ui.oss-cn-beijing.aliyuncs.com/carousel-img/carousel4.jpeg" | ||
> | ||
</n-carousel-item> | ||
</n-carousel> | ||
</template> | ||
|
||
<style> | ||
.carousel-img { | ||
margin: 0 auto; | ||
width: 100%; | ||
height: 100%; | ||
object-fit: cover; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters