diff --git a/pages/devices/_deviceId/basic/edit.vue b/pages/devices/_deviceId/basic/edit.vue index f1026a82a9fe0fee5212b79e6fcd3d099dd10258..4fdf8ba7626c4dfdf6b2094606cf6bdc30e11a1b 100644 --- a/pages/devices/_deviceId/basic/edit.vue +++ b/pages/devices/_deviceId/basic/edit.vue @@ -49,7 +49,7 @@ </template> <script lang="ts"> -import { Component, Vue, Prop } from 'nuxt-property-decorator' +import { Component, Vue, Prop, Watch } from 'nuxt-property-decorator' import DeviceBasicDataForm from '@/components/DeviceBasicDataForm.vue' @@ -101,5 +101,11 @@ export default class DeviceEditBasicPage extends Vue { get isLoggedIn () { return this.$store.getters['oidc/isAuthenticated'] } + + @Watch('value', { immediate: true, deep: true }) + // @ts-ignore + onDeviceChanged (val: Device) { + this.deviceCopy = Device.createFromObject(val) + } } </script>