Francesco Torchia aba9c167e0
Vue3 migration - vue-migration.js launch + shell compatibility fixes
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2024-10-23 17:00:51 +02:00

51 lines
848 B
Vue

<script>
import UnitInput from '@shell/components/form/UnitInput';
export default {
name: 'HarvesterReserved',
components: { UnitInput },
props: {
reservedMemory: {
type: String,
default: null
},
mode: {
type: String,
default: 'create',
},
},
data() {
return { memory: this.reservedMemory };
},
watch: {
reservedMemory(memory) {
this.memory = memory;
},
},
methods: {
change() {
const { memory } = this;
this.$emit('updateReserved', { memory });
},
}
};
</script>
<template>
<UnitInput
v-model:value="memory"
v-int-number
:label="t('harvester.virtualMachine.input.reservedMemory')"
:mode="mode"
:input-exponent="2"
:increment="1024"
:output-modifier="true"
@update:value="change"
/>
</template>