base_ui/plugins/vuelidate.ts
Mehdi104797 0d0fd2dacd .
2025-02-27 08:55:27 +03:30

31 lines
859 B
TypeScript

// import { createApp } from "vue";
// import Vuelidate from "@vuelidate/core";
// createApp.use(Vuelidate);
import { useVuelidate } from '@vuelidate/core'
// import { required, minLength } from '@vuelidate/validators'
// export default defineNuxtPlugin((nuxtApp) => {
// nuxtApp.vueApp.use((useVuelidate) => {
// // // Example of global setup, but typically you'd handle this in the component
// // const state = reactive({
// // firstName: ''
// // })
// // const rules = {
// // firstName: {
// // required,
// // minLength: minLength(2)
// // }
// // }
// // const v$ = useVuelidate(rules, state)
// // return v$;
// // // Return the v$ instance or any other necessary setup
// })
// })
export default defineNuxtPlugin(nuxtApp => {
nuxtApp.provide('vuelidate', useVuelidate)
})