|
@@ -106,9 +106,25 @@ export default {
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
this.$ls.clear();
|
|
this.$ls.clear();
|
|
|
|
+ document.addEventListener("keyup", this.keyEvent);
|
|
|
|
+ },
|
|
|
|
+ beforeDestroy() {
|
|
|
|
+ document.removeEventListener("keyup", this.keyEvent);
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
...mapMutations("marker", ["setRibbonSet"]),
|
|
...mapMutations("marker", ["setRibbonSet"]),
|
|
|
|
+ keyEvent(e) {
|
|
|
|
+ if (
|
|
|
|
+ !e.altKey &&
|
|
|
|
+ !e.shiftKey &&
|
|
|
|
+ !e.ctrlKey &&
|
|
|
|
+ !e.repeat &&
|
|
|
|
+ e.key === "Enter"
|
|
|
|
+ ) {
|
|
|
|
+ e.preventDefault();
|
|
|
|
+ this.submit("loginForm");
|
|
|
|
+ }
|
|
|
|
+ },
|
|
async submit(name) {
|
|
async submit(name) {
|
|
const valid = await this.$refs[name].validate();
|
|
const valid = await this.$refs[name].validate();
|
|
if (!valid) return;
|
|
if (!valid) return;
|