mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-10 18:23:50 +00:00
Bot-rename to script setup
This commit is contained in:
parent
f4d4309be3
commit
1b2c4c3d31
|
@ -21,33 +21,24 @@
|
|||
</form>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
<script setup lang="ts">
|
||||
import { useBotStore } from '@/stores/ftbotwrapper';
|
||||
import { BotDescriptor } from '@/types';
|
||||
import { defineComponent, ref } from 'vue';
|
||||
import { ref } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'BotRename',
|
||||
props: {
|
||||
bot: { type: Object as () => BotDescriptor, required: true },
|
||||
},
|
||||
emits: ['cancelled', 'saved'],
|
||||
setup(props, { emit }) {
|
||||
const botStore = useBotStore();
|
||||
|
||||
const newName = ref<string>(props.bot.botName);
|
||||
|
||||
const save = () => {
|
||||
botStore.updateBot(props.bot.botId, {
|
||||
botName: newName.value,
|
||||
});
|
||||
|
||||
emit('saved');
|
||||
};
|
||||
return {
|
||||
newName,
|
||||
save,
|
||||
};
|
||||
},
|
||||
const props = defineProps({
|
||||
bot: { type: Object as () => BotDescriptor, required: true },
|
||||
});
|
||||
const emit = defineEmits(['cancelled', 'saved']);
|
||||
const botStore = useBotStore();
|
||||
|
||||
const newName = ref<string>(props.bot.botName);
|
||||
|
||||
const save = () => {
|
||||
botStore.updateBot(props.bot.botId, {
|
||||
botName: newName.value,
|
||||
});
|
||||
|
||||
emit('saved');
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue
Block a user