|
|
|
@ -2,19 +2,39 @@
|
|
|
|
|
<div class="shot">
|
|
|
|
|
<button class="remove" @click="emit('remove')">x</button>
|
|
|
|
|
<img :src="img">
|
|
|
|
|
<div class="meta">
|
|
|
|
|
<div class="meta" v-if="!edit" @dblclick="edit=true">
|
|
|
|
|
<span class="order">{{order}}</span>
|
|
|
|
|
<h3 class="title" >{{title}}</h3>
|
|
|
|
|
<p class="description">{{description}}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<form class="meta" v-else>
|
|
|
|
|
<input class="title" v-model="shotTitle">
|
|
|
|
|
<textarea class="description" v-model="shotDescription"></textarea>
|
|
|
|
|
<button @click.prevent="update">Confirm</button>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
<script setup>
|
|
|
|
|
|
|
|
|
|
import {ref } from 'vue'
|
|
|
|
|
|
|
|
|
|
const props = defineProps(['title', 'description', 'img', 'order'])
|
|
|
|
|
const emit = defineEmits(['remove'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const shotTitle = ref(props.title)
|
|
|
|
|
const shotDescription = ref(props.description)
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['remove', 'update'])
|
|
|
|
|
|
|
|
|
|
const edit = ref(false)
|
|
|
|
|
|
|
|
|
|
const update = () => {
|
|
|
|
|
emit('update', {title: shotTitle.value, description: shotDescription.value, order: props.order})
|
|
|
|
|
edit.value = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
<style>
|
|
|
|
|