Vue does not click the submit button. Submit is triggered when input is typed. I don't know why.

vue does not click the submit button and triggers submit when input is typed. I don"t know why.

because I don"t want to refresh when submit is triggered, I add prevent
I write a custom form verification instruction for myself

related code
.vue page

<template>
  <div>
    1_1
    <form novalidate @submit.stop.prevent.self v-submit="dosubmit()" >
      <input type="text" v-model="a" name="a" required minlength="2" maxlength="6" pattern="/^\d*$/" />
      <input type="submit" value="" />
    </form>
  </div>
</template>

<script>
export default {
  name: "caidan1_1",
  data () {
    return {
      a:""
    }
  },
  methods:{
    dosubmit:function(){
      debugger
      console.log(this.a);
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

</style>

and my custom instructions, I haven"t finished yet. Please don"t.

import Vue from "vue";
const types=["checkbox","color","date","datetime","datetime-local","month","week","time","email","file","hidden","number","password","radio","range","search","tel","text","url"];
Vue.directive("submit",{
    bind:function(el,binding,vnode,oldVnode){
        
    },
    inserted:function(el,binding,vnode,oldVnode){
        debugger
        el.addEventListener("submit",function(){
            scope[fn.replace(/\(.*\)/,"")]();
        });
        const scope=vnode.context;
        const fn=binding.expression;
        const vModelList=[];
    },
    update:function(el,binding,vnode,oldVnode){},
    componentUpdated:function(el,binding,vnode,oldVnode){},
    unbind:function(el,binding,vnode,oldVnode){}
});


May.07,2021

I won't have this problem if I remove vmursubmit= "dosubmit ()". It's probably because there's something wrong with my instructions. I'll see for myself.

v dosubmit submitt = "dosubmit", you can't bring (), drunk, @ click can bring it. It's strange. If that's the case, it won't work if you want to bring parameters to submit

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5820d-43f65.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5820d-43f65.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?