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