mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 13:27:08 +00:00
Refactor <dougal-project-settings-file-path/>
This commit is contained in:
@@ -8,11 +8,11 @@
|
||||
label="Project folder"
|
||||
hint="Root file path for this project"
|
||||
persistent-hint
|
||||
v-model="path"
|
||||
v-model="rootPath_"
|
||||
>
|
||||
<dougal-file-browser-dialog
|
||||
slot="append"
|
||||
v-model="path"
|
||||
v-model="rootPath_"
|
||||
mimetypes="inode/directory"
|
||||
></dougal-file-browser-dialog>
|
||||
</v-text-field>
|
||||
@@ -45,30 +45,32 @@ export default {
|
||||
|
||||
components: { DougalFileBrowserDialog },
|
||||
|
||||
props: [ "value" ],
|
||||
props: [ "rootPath" ],
|
||||
|
||||
data () {
|
||||
return {
|
||||
path: ""
|
||||
rootPath_: ""
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
value (newValue) {
|
||||
this.reset();
|
||||
|
||||
rootPath () {
|
||||
if (this.rootPath != this.rootPath_) {
|
||||
this.reset();
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
reset () {
|
||||
for (const key of Object.keys(this.$data)) {
|
||||
this[key] = this.value[key];
|
||||
}
|
||||
this.rootPath_ = this.rootPath;
|
||||
},
|
||||
|
||||
save () {
|
||||
this.$emit('input', {...this.$data});
|
||||
this.$emit('input', {rootPath: this.rootPath_});
|
||||
},
|
||||
|
||||
back () {
|
||||
|
||||
Reference in New Issue
Block a user