fix mount reactiveness, #128.

This commit is contained in:
Miroslav Šedivý
2024-06-17 22:00:06 +02:00
parent 76c0d28c28
commit e61f6bf624
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -36,7 +36,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { Vue, Component, Prop } from 'vue-property-decorator' import { Vue, Component } from 'vue-property-decorator'
import Home from './views/Home.vue' import Home from './views/Home.vue'
@Component({ @Component({
+4 -4
View File
@@ -225,7 +225,7 @@
<h2> Environment variables </h2> <h2> Environment variables </h2>
<v-btn @click="addEnv" icon color="green"><v-icon>mdi-plus</v-icon></v-btn> <v-btn @click="addEnv" icon color="green"><v-icon>mdi-plus</v-icon></v-btn>
</v-row> </v-row>
<v-row align="center" v-for="({ key, val }, index) in envList" :key="index"> <v-row align="center" v-for="({ key, val }, index) in envList" :key="'env-'+index">
<v-col class="py-0"> <v-col class="py-0">
<v-text-field <v-text-field
label="Key" label="Key"
@@ -251,7 +251,7 @@
<h2> Mounts </h2> <h2> Mounts </h2>
<v-btn @click="addMount" icon color="green"><v-icon>mdi-plus</v-icon></v-btn> <v-btn @click="addMount" icon color="green"><v-icon>mdi-plus</v-icon></v-btn>
</v-row> </v-row>
<v-row align="center" class="mb-2" v-for="({ type, host_path, container_path }, index) in data.mounts" :key="index"> <v-row align="center" class="mb-2" v-for="({ type, host_path, container_path }, index) in data.mounts" :key="'mount-'+index">
<v-col class="py-0" cols="2"> <v-col class="py-0" cols="2">
<v-select <v-select
label="Type" label="Type"
@@ -726,13 +726,13 @@ export default class RoomsCreate extends Vue {
} else { } else {
mounts[index] = data mounts[index] = data
} }
Vue.set(this.data, 'mounts', mounts) Vue.set(this.data, 'mounts', [ ...mounts])
} }
delMount(index: number) { delMount(index: number) {
const mounts = this.data.mounts || [] const mounts = this.data.mounts || []
mounts.splice(index, 1) mounts.splice(index, 1)
Vue.set(this.data, 'mounts', mounts) Vue.set(this.data, 'mounts', [ ...mounts])
} }
async CreateAndStart() { async CreateAndStart() {