最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

vue.js - How do I activate or deactivate a form's submit button once the [child-side] fields have been validated? - Stac

programmeradmin1浏览0评论

component parent

<q-form
  @submit="onsubmit"
  class="q-gutter-md"
  style="min-width: 100% !important;margin-left: 5px !important;">
    <div class="col-12 Bloc-Container-Principal">
      <div class="col-12 Bloc-Container">
        <BlocAgent v-model:BlocAgent ="dataPersonne"
                   v-model:FormColor ="DataFormColor"
                   v-model:ActionForm ="ActionForm"
        />
      </div>
      <div>
        <q-btn
           label="Soumettre"
           color="positive"
           type="submit"
        />
      <div>
    </div>
</q-form>

component enfant

 <div class="col champ-dialog">
   <span class="Libelle-Titre">Nom </span>
     <q-input
       dense
       v-model="DataAgent.nom"
       :rules="[NomNullRule]"/>
  </div>

function rules

const NomNullRule = val => {
  if (val === null || val === undefined) {
    return 'Le nom est obligatoire.'
  }
  return true
}

Can you give me some advice? I can't find a solution to retrieve the different values of the rule before the sbmit. thank you

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论