Files
Noblet Ouways 2f17df1209 style(eslint-config): newline before import type (#21036)
* perf: change to import-x

* feat: add rules

* chore: fix rule

* chore: fix

* chore: fix

* chore: fix

* style: `pnpm lint:fix`

* Revert "style: `pnpm lint:fix`"

This reverts commit db0116a288299c507e3cfc4d7a22e2207265d920.

* Revert "chore: fix"

This reverts commit 69c82a90c01525e38180be4c21e8ef5602512318.

* chore: fix

* style: `pnpm lint:fix`

* fix: lint

* chore: `pnpm format`
2025-06-16 15:37:12 +08:00

48 lines
924 B
Vue

<template>
<div class="demo-fit">
<div v-for="fit in fits" :key="fit" class="block">
<span class="title">{{ fit }}</span>
<el-avatar shape="square" :size="100" :fit="fit" :src="url" />
</div>
</div>
</template>
<script lang="ts" setup>
import { reactive, toRefs } from 'vue'
import type { ObjectFitProperty } from 'csstype'
const state = reactive({
fits: [
'fill',
'contain',
'cover',
'none',
'scale-down',
] as ObjectFitProperty[],
url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
})
const { fits, url } = toRefs(state)
</script>
<style scoped>
.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: var(--el-text-color-secondary);
}
</style>