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: '' }),
} |
1 reply
|
@logaretm Thanks for your support and help met to suggest the correct way. |
0 replies
|
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 |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
VueJS: 3.2.45
Vee Validate: 4.7.3
Yup: 0.32.11
MyComponent.Vue
Here I want to check my
mobilefield is valid or not out of theFormfield usingMethodsand 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
Metaif theFieldcomponent.Anyone faced the same issue and passed the same scenario help me to get it.
Thanks
All reactions