Replies: 3 comments 2 replies
-
Moved to Q&A discussions. I would recommend using the composable <template>
<Form :validateOnModelUpdate="true">
<Field name="mobile" as="input" :rules="mobileRules" v-model="mobile" />
</Form>
// Want to display button if the validation match
// Out side of the form
<button class="btn btn-default" v-if="meta.valid" > Next </button>
</template>
<script>
import * as Yup from 'yup';
export default {
setup() {
const mobileRules = Yup.string().required().min(6);
const { meta } = useForm();
return { meta, mobileRules };
},
data: () => ({ mobile: '' }),
} |
Beta Was this translation helpful? Give feedback.
-
@logaretm Thanks for your support and help met to suggest the correct way.
|
Beta Was this translation helpful? Give feedback.
-
Hey 👋 Thank you very much for your answer. I understand the recommended way to programmatically access the meta of a Field is by using the composition API. Still, is there a way to do so using only the components approach ? Maybe by putting a |
Beta Was this translation helpful? Give feedback.
-
VueJS: 3.2.45
Vee Validate: 4.7.3
Yup: 0.32.11
MyComponent.Vue
Here I want to check my
mobile
field is valid or not out of theForm
field usingMethods
and want to hide/show the button of theNext
.I find too much on the issues of this repository and on stackoverflow but as per my need I do not find anything and also no way to get
Meta
if theField
component.Anyone faced the same issue and passed the same scenario help me to get it.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions