mirror of
https://github.com/element-plus/element-plus.git
synced 2025-02-23 11:59:34 +08:00
38 lines
760 B
Vue
38 lines
760 B
Vue
<template>
|
|
<div class="demo-fit">
|
|
<div class="block" v-for="fit in fits" :key="fit">
|
|
<span class="title">{{ fit }}</span>
|
|
<el-avatar shape="square" :size="100" :fit="fit" :src="url"></el-avatar>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
<script lang="ts">
|
|
export default {
|
|
data() {
|
|
return {
|
|
fits: ['fill', 'contain', 'cover', 'none', 'scale-down'],
|
|
url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg'
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
.demo-fit {
|
|
display:flex;
|
|
text-align:center;
|
|
justify-content:space-between
|
|
}
|
|
.demo-fit .block {
|
|
flex:1;
|
|
display:flex;
|
|
flex-direction:column;
|
|
flex-grow:0
|
|
}
|
|
.demo-fit .title {
|
|
margin-bottom:10px;
|
|
font-size:14px;
|
|
color:#8492a6
|
|
}
|
|
</style>
|