Pārlūkot izejas kodu

fix Awesomplete not refreshing after passwords update

pull/342/head
Guillaume Vincent pirms 7 gadiem
vecāks
revīzija
6523044754
1 mainītis faili ar 15 papildinājumiem un 11 dzēšanām
  1. +15
    -11
      src/views/PasswordGenerator.vue

+ 15
- 11
src/views/PasswordGenerator.vue Parādīt failu

@@ -176,17 +176,6 @@
});
},
mounted(){
const self = this;
new Awesomplete(this.$refs.site, {
list: this.passwords.map(password => {
return {label: password.site + ' ' + password.login, value: password}
}),
replace: function (password) {
self.$store.dispatch('savePassword', {password: password.value});
this.input.value = password.value.site;
}
});

if (this.password.site) {
this.$refs.login.focus();
} else {
@@ -205,6 +194,21 @@
}
},
watch: {
'passwords': function (passwords) {
var site = document.getElementById('site');
const self = this;
if (site !== null && passwords.length > 0) {
new Awesomplete(site, {
list: passwords.map(password => {
return {label: password.site + ' ' + password.login, value: password}
}),
replace: function (password) {
self.$store.dispatch('savePassword', {password: password.value});
this.input.value = password.value.site;
}
});
}
},
'password.site': function () {
this.cleanErrors();
},


Notiek ielāde…
Atcelt
Saglabāt