feat quick-add-magic script setup (#1926)

Co-authored-by: Dominik Pschenitschni <mail@celement.de>
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/1926
Co-authored-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
Co-committed-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
This commit is contained in:
Dominik Pschenitschni 2022-05-14 15:02:41 +00:00 committed by konrad
parent 6737bb37b4
commit 1bf378608e

View file

@ -85,26 +85,14 @@
</div>
</template>
<script lang="ts">
<script setup lang="ts">
import {getQuickAddMagicMode} from '@/helpers/quickAddMagicMode'
import {PREFIXES} from '@/modules/parseTaskText'
import { defineComponent } from 'vue'
import {ref, computed} from 'vue'
export default defineComponent({
name: 'quick-add-magic',
data() {
return {
visible: false,
mode: getQuickAddMagicMode(),
}
},
computed: {
available() {
return this.mode !== 'disabled'
},
prefixes() {
return PREFIXES[this.mode]
},
},
})
const visible = ref(false)
const mode = ref(getQuickAddMagicMode())
const available = computed(() => mode.value !== 'disabled')
const prefixes = computed(() =>PREFIXES[mode.value])
</script>