refactor: everything to nuxt.js
This commit is contained in:
5
app/components/boat/BoatComponent.vue
Normal file
5
app/components/boat/BoatComponent.vue
Normal file
@@ -0,0 +1,5 @@
|
||||
<template>
|
||||
<div>My component</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts"></script>
|
||||
35
app/components/boat/BoatPickerComponent.vue
Normal file
35
app/components/boat/BoatPickerComponent.vue
Normal file
@@ -0,0 +1,35 @@
|
||||
<script setup lang="ts">
|
||||
import { useBoatStore } from '~/stores/boat';
|
||||
import type { Boat } from '~/utils/boat.types';
|
||||
|
||||
const boats = useBoatStore().boats;
|
||||
const boat = <Boat | undefined>undefined;
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<q-select v-model="boat" :options="boats" option-value="id" option-label="name" label="Boat">
|
||||
<template v-slot:prepend>
|
||||
<q-item-section avatar>
|
||||
<q-img v-if="boat?.iconSrc" :src="boat?.iconSrc" />
|
||||
<q-icon v-else name="sailing" />
|
||||
</q-item-section>
|
||||
</template>
|
||||
<template v-slot:option="scope">
|
||||
<q-item v-bind="scope.itemProps">
|
||||
<q-item-section avatar>
|
||||
<q-img :src="scope.opt.iconsrc" />
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>{{ scope.opt.name }}</q-item-label>
|
||||
<q-item-label caption>{{ scope.opt.class }}</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section avatar v-if="scope.opt.defects">
|
||||
<q-icon name="warning" color="warning" />
|
||||
<q-tooltip class="bg-amber text-black shadow-7">
|
||||
This boat has notices. Select it to see details.
|
||||
</q-tooltip>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</template>
|
||||
25
app/components/boat/BoatPreviewComponent.vue
Normal file
25
app/components/boat/BoatPreviewComponent.vue
Normal file
@@ -0,0 +1,25 @@
|
||||
<script setup lang="ts">
|
||||
import type { Boat } from '~/utils/boat.types';
|
||||
|
||||
defineProps({ boats: Array<Boat> });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="boats" class="row">
|
||||
<q-card
|
||||
v-for="boat in boats"
|
||||
:key="boat.$id"
|
||||
class="q-ma-sm col-xs-12 col-sm-6 col-xl-3">
|
||||
<q-card-section>
|
||||
<q-img :src="boat.imgSrc" :fit="'scale-down'">
|
||||
<div class="row absolute-top">
|
||||
<div class="col text-h6 text-left">{{ boat.name }}</div>
|
||||
<div class="col text-right">{{ boat.class }}</div>
|
||||
</div>
|
||||
</q-img>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
</q-card>
|
||||
</div>
|
||||
<div v-else><q-card>Sorry, no boats to show you!</q-card></div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user