This commit is contained in:
brusnitsyn
2026-02-20 17:28:16 +09:00
parent 94e374c32b
commit 52a80ccd3b
41 changed files with 2555 additions and 206 deletions

View File

@@ -0,0 +1,13 @@
<script setup>
</script>
<template>
<div class="max-w-6xl mx-auto mt-6 mb-4 w-full">
<slot />
</div>
</template>
<style scoped>
</style>

View File

@@ -0,0 +1,65 @@
<script setup>
import { NFormItem, NCard, NScrollbar } from 'naive-ui'
import {computed, ref, watch} from "vue";
const props = defineProps({
header: {
type: String,
default: ''
},
feedback: {
type: String,
default: ''
},
minH: {
type: [String, Number],
default: null
},
maxH: {
type: [String, Number],
default: null
},
})
const hasHeader = computed(() => props.header.trim().length > 0)
const hasFeedback = computed(() => props.feedback.trim().length > 0)
const hasMinH = computed(() => props.minH.trim().length > 0 || Number.isInteger(props.minH))
const hasMaxH = computed(() => props.maxH.trim().length > 0 || Number.isInteger(props.maxH))
const styles = ref([])
watch(() => [props.minH, props.maxH], ([minH, maxH]) => {
const sizeStyles = []
if (minH === null) return
if (minH.trim().length > 0) {
sizeStyles.push(`min-height: ${minH};`)
} else if (Number.isInteger(minH)) {
sizeStyles.push(`min-height: ${minH}px;`)
}
if (maxH === null) return
if (maxH.trim().length > 0) {
sizeStyles.push(`max-height: ${maxH};`)
} else if (Number.isInteger(maxH)) {
sizeStyles.push(`max-height: ${maxH}px;`)
}
styles.value = styles.value.concat(sizeStyles)
}, {
immediate: true
})
</script>
<template>
<NFormItem :show-label="hasHeader" :label="header" :show-feedback="hasFeedback" :feedback="feedback">
<NCard>
<NScrollbar :style="styles">
<slot />
</NScrollbar>
</NCard>
</NFormItem>
</template>
<style scoped>
</style>