mirror of
https://github.com/element-plus/element-plus.git
synced 2025-12-19 09:09:40 +08:00
* docs: improve examples layout for narrow screens * docs: style related * style: [statistic] use utilities * style: [input] remove deep * style: [transitions] change style * refactor: [date-picker-panel] narrow refactor
46 lines
1009 B
Vue
46 lines
1009 B
Vue
<template>
|
|
<div
|
|
ref="containerRef"
|
|
:class="['date-picker--example', { 'is-narrow': isNarrow }]"
|
|
>
|
|
<div class="text-center">No border:</div>
|
|
<el-divider />
|
|
<div class="date-picker--flex-container">
|
|
<div class="p-[20px]">
|
|
<el-date-picker-panel v-model="value" :border="false" />
|
|
</div>
|
|
<el-divider
|
|
class="divider"
|
|
:direction="isNarrow ? 'horizontal' : 'vertical'"
|
|
/>
|
|
<el-card>
|
|
<el-date-picker-panel v-model="value" :border="false" />
|
|
</el-card>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { computed, ref } from 'vue'
|
|
import { useElementSize } from '@vueuse/core'
|
|
|
|
const value = ref()
|
|
const containerRef = ref<HTMLElement>()
|
|
|
|
const { width } = useElementSize(containerRef)
|
|
|
|
const isNarrow = computed(() => width.value < 815)
|
|
</script>
|
|
|
|
<style scoped>
|
|
.date-picker--flex-container {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 16px;
|
|
justify-content: center;
|
|
}
|
|
.divider {
|
|
height: auto;
|
|
}
|
|
</style>
|