Files
filebrozer/frontend/src/components/settings/Commands.vue
Henrique Dias 83492a4dfb feat(frontend): migrate Vue to Composition API
Signed-off-by: Henrique Dias <mail@hacdias.com>
2025-11-13 14:23:20 +01:00

35 lines
690 B
Vue

<template>
<div>
<h3>{{ $t("settings.userCommands") }}</h3>
<p class="small">
{{ $t("settings.userCommandsHelp") }} <i>git svn hg</i>.
</p>
<input class="input input--block" type="text" v-model.trim="raw" />
</div>
</template>
<script setup lang="ts">
import { computed } from "vue";
const props = defineProps<{
commands: string[];
}>();
const emit = defineEmits<{
"update:commands": [commands: string[]];
}>();
const raw = computed({
get() {
return props.commands.join(" ");
},
set(value: string) {
if (value !== "") {
emit("update:commands", value.split(" "));
} else {
emit("update:commands", []);
}
},
});
</script>