chore: script setup components (#7299)

This commit is contained in:
Kuchenpirat
2026-03-23 21:18:25 +01:00
committed by GitHub
parent 3ad2d9155d
commit 5ab6e98f9e
47 changed files with 1721 additions and 2453 deletions

View File

@@ -39,71 +39,63 @@
</div>
</template>
<script lang="ts">
export default defineNuxtComponent({
props: {
loading: {
type: Boolean,
default: true,
},
tiny: {
type: Boolean,
default: false,
},
small: {
type: Boolean,
default: false,
},
medium: {
type: Boolean,
default: true,
},
large: {
type: Boolean,
default: false,
},
waitingText: {
type: String,
default: undefined,
},
<script setup lang="ts">
const props = defineProps({
loading: {
type: Boolean,
default: true,
},
setup(props) {
const size = computed(() => {
if (props.tiny) {
return {
width: 2,
icon: 0,
size: 25,
};
}
if (props.small) {
return {
width: 2,
icon: 30,
size: 50,
};
}
else if (props.large) {
return {
width: 4,
icon: 120,
size: 200,
};
}
return {
width: 3,
icon: 75,
size: 125,
};
});
const i18n = useI18n();
const waitingTextCalculated = props.waitingText == null ? i18n.t("general.loading-recipes") : props.waitingText;
return {
size,
waitingTextCalculated,
};
tiny: {
type: Boolean,
default: false,
},
small: {
type: Boolean,
default: false,
},
medium: {
type: Boolean,
default: true,
},
large: {
type: Boolean,
default: false,
},
waitingText: {
type: String,
default: undefined,
},
});
const size = computed(() => {
if (props.tiny) {
return {
width: 2,
icon: 0,
size: 25,
};
}
if (props.small) {
return {
width: 2,
icon: 30,
size: 50,
};
}
else if (props.large) {
return {
width: 4,
icon: 120,
size: 200,
};
}
return {
width: 3,
icon: 75,
size: 125,
};
});
const i18n = useI18n();
const waitingTextCalculated = props.waitingText == null ? i18n.t("general.loading-recipes") : props.waitingText;
</script>