template after script
This commit is contained in:
1 parent
08325e965a
commit
521a10106d
3 files changed
+31
-31
No files matched your search
+13
-13
@@ -1,21 +1,9 @@
|
|||||||
<template>
|
|
||||||
<div v-for="route in routes" class="button">
|
|
||||||
<a :href="'#' + (routes[route] || '/')"> {{ route }}</a>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label>Files
|
|
||||||
<input id="fileUpload" type="file" @change="handleFilesUpload($event as InputFileEvent)" />
|
|
||||||
</label>
|
|
||||||
<button :class="sent ? 'green' : 'normal'" @click="submitImage()">{{ sent ? 'Sent' : 'Submit' }}</button>
|
|
||||||
</div>
|
|
||||||
<component :is="currentView" :key="sent" :images="images" @delete="deleteFile" />
|
|
||||||
</template>
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Home from './components/Home.vue'
|
import Home from './components/Home.vue'
|
||||||
import Gallery from './components/Gallery.vue';
|
import Gallery from './components/Gallery.vue';
|
||||||
import NotFound from './components/NotFound.vue'
|
import NotFound from './components/NotFound.vue'
|
||||||
import { defineComponent } from 'vue'
|
import { defineComponent } from 'vue'
|
||||||
import { api } from './http-api'
|
import { api } from '@/http-api'
|
||||||
import { ImageType, ImageClass } from './image';
|
import { ImageType, ImageClass } from './image';
|
||||||
</script>
|
</script>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@@ -85,6 +73,18 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
<template>
|
||||||
|
<div v-for="route in routes" class="button">
|
||||||
|
<a :href="'#' + (routes[route] || '/')"> {{ route }}</a>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Files
|
||||||
|
<input id="fileUpload" type="file" @change="handleFilesUpload($event as InputFileEvent)" />
|
||||||
|
</label>
|
||||||
|
<button :class="sent ? 'green' : 'normal'" @click="submitImage()">{{ sent ? 'Sent' : 'Submit' }}</button>
|
||||||
|
</div>
|
||||||
|
<component :is="currentView" :key="sent" :images="images" @delete="deleteFile" />
|
||||||
|
</template>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.button {
|
.button {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
<template>
|
|
||||||
<div class="flex" v-if="images.keys != null">
|
|
||||||
<Image v-for="[id, image] in images" :key="id" :id="id" />
|
|
||||||
</div>
|
|
||||||
<h1 v-else>No image found</h1>
|
|
||||||
</template>
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { defineComponent } from 'vue'
|
import { defineComponent } from 'vue'
|
||||||
import { ImageType } from '@/image'
|
import { ImageType } from '@/image'
|
||||||
@@ -21,6 +15,12 @@ export default defineComponent({
|
|||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="flex" v-if="images.keys != null">
|
||||||
|
<Image v-for="[id, image] in images" :key="id" :id="id" />
|
||||||
|
</div>
|
||||||
|
<h1 v-else>No image found</h1>
|
||||||
|
</template>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.flex {
|
.flex {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -1,15 +1,3 @@
|
|||||||
<template>
|
|
||||||
<div class="flex" v-if="images.keys != null">
|
|
||||||
<div>
|
|
||||||
<select v-model="imageSelectedId" style="width: min-content;margin: 15px;">
|
|
||||||
<option v-for="[id, image] in images" :key="id" :value="id">{{ image.name }}</option>
|
|
||||||
</select>
|
|
||||||
<button @click="$emit('delete', imageSelectedId)">Delete</button>
|
|
||||||
</div>
|
|
||||||
<Image :id="imageSelectedId"></Image>
|
|
||||||
</div>
|
|
||||||
<h1 v-else>No images found</h1>
|
|
||||||
</template>
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Image from '@/components/Image.vue'
|
import Image from '@/components/Image.vue'
|
||||||
import { defineComponent } from 'vue'
|
import { defineComponent } from 'vue'
|
||||||
@@ -48,6 +36,18 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
<template>
|
||||||
|
<div class="flex" v-if="images.keys != null">
|
||||||
|
<div>
|
||||||
|
<select v-model="imageSelectedId" style="width: min-content;margin: 15px;">
|
||||||
|
<option v-for="[id, image] in images" :key="id" :value="id">{{ image.name }}</option>
|
||||||
|
</select>
|
||||||
|
<button @click="$emit('delete', imageSelectedId)">Delete</button>
|
||||||
|
</div>
|
||||||
|
<Image :id="imageSelectedId"></Image>
|
||||||
|
</div>
|
||||||
|
<h1 v-else>No images found</h1>
|
||||||
|
</template>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.flex {
|
.flex {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
Reference in new issue
Block a user