fix(518e78c286): uncorresponding value of select box

This commit is contained in:
mzz2017 committed 2021-08-12 12:30:28 +08:00
1 parent 4bfb72ad32
commit cc025d7da5
1 file changed
+13 -9
+13 -9
View File
@@ -672,15 +672,6 @@ export default {
}
},
mounted() {
if (this.readonly) {
this.$refs.section
.querySelectorAll("input, textarea")
.forEach(x => (x.readOnly = "readOnly"));
this.$refs.section.querySelectorAll("select").forEach(x => {
const text = x.querySelector(`option[value="${x.value}"]`).textContent;
x.outerHTML = `<input type="text" class="input" readonly="readonly" value="${text}">`;
});
}
if (localStorage["vlessValid"] === "true") {
this.showVLess = true;
this.vlessVersion = 1;
@@ -737,6 +728,19 @@ export default {
this.trojan = this.resolveURL(res.data.data.sharingAddress);
this.tabChoice = 4;
}
this.$nextTick(() => {
if (this.readonly) {
this.$refs.section
.querySelectorAll("input, textarea")
.forEach(x => (x.readOnly = "readOnly"));
this.$refs.section.querySelectorAll("select").forEach(x => {
const text = x.querySelector(`option[value="${x.value}"]`)
.textContent;
console.log(x.value, text);
x.outerHTML = `<input type="text" class="input" readonly="readonly" value="${text}">`;
});
}
});
});
});
}