wip
This commit is contained in:
1 parent
3157946186
commit
e62747d62d
8 files changed
+161
-38
No files matched your search
@@ -2,17 +2,17 @@
|
||||
import { ref } from 'vue'
|
||||
|
||||
interface Props {
|
||||
value?: string
|
||||
text?: string
|
||||
}
|
||||
|
||||
const props = defineProps<Props>()
|
||||
const emit = defineEmits<{ changed: [value: string] }>()
|
||||
const emit = defineEmits<{ changed: [text: string] }>()
|
||||
|
||||
const editing = ref(false)
|
||||
const draft = ref(props.value ?? '')
|
||||
const draft = ref(props.text ?? '')
|
||||
|
||||
const startEdit = () => {
|
||||
draft.value = props.value ?? ''
|
||||
draft.value = props.text ?? ''
|
||||
editing.value = true
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ const save = () => {
|
||||
}
|
||||
|
||||
const cancel = () => {
|
||||
draft.value = props.value ?? ''
|
||||
draft.value = props.text ?? ''
|
||||
editing.value = false
|
||||
}
|
||||
</script>
|
||||
@@ -30,8 +30,8 @@ const cancel = () => {
|
||||
<template>
|
||||
<div class="issue-content">
|
||||
<template v-if="!editing">
|
||||
<v-sheet class="pa-2 cursor-pointer content-sheet" @click="startEdit">
|
||||
{{ value ?? 'click to add content' }}
|
||||
<v-sheet class="pa-4 cursor-pointer content-sheet" @click="startEdit">
|
||||
{{ text ?? 'click to add content' }}
|
||||
</v-sheet>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in new issue
Block a user