feat(webui): allow direct input of library path in add dialog

closes #88
This commit is contained in:
Gauthier Roebroeck 2020-06-26 11:34:36 +08:00
parent 0297210dc2
commit 6ece7b12be
2 changed files with 10 additions and 5 deletions

View file

@ -79,6 +79,7 @@ export default Vue.extend({
},
watch: {
value (val) {
if (val) this.dialogInit()
this.modalFileBrowser = val
},
modalFileBrowser (val) {
@ -100,10 +101,15 @@ export default Vue.extend({
default: 'Choose',
},
},
async mounted () {
this.getDirs()
},
methods: {
dialogInit () {
try {
this.getDirs(this.path)
this.selectedPath = this.path
} catch (e) {
this.getDirs()
}
},
dialogCancel () {
this.$emit('input', false)
},

View file

@ -45,7 +45,6 @@
<v-text-field v-model="form.path"
label="Root folder"
disabled
:error-messages="getErrors('path')"
@input="$v.form.path.$touch()"
@blur="$v.form.path.$touch()"
@ -85,8 +84,8 @@
</template>
<script lang="ts">
import Vue from 'vue'
import FileBrowserDialog from '@/components/FileBrowserDialog.vue'
import Vue from 'vue'
import { required } from 'vuelidate/lib/validators'
export default Vue.extend({