base_ui/plugins/vuelidate.ts

31 lines
859 B
TypeScript
Raw Normal View History

2025-02-01 09:34:55 +00:00
// import { createApp } from "vue";
// import Vuelidate from "@vuelidate/core";
// createApp.use(Vuelidate);
import { useVuelidate } from '@vuelidate/core'
2025-02-27 05:25:27 +00:00
// import { required, minLength } from '@vuelidate/validators'
2025-02-01 09:34:55 +00:00
2025-02-27 05:25:27 +00:00
// 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
// })
// })
2025-02-01 09:34:55 +00:00
2025-02-27 05:25:27 +00:00
export default defineNuxtPlugin(nuxtApp => {
nuxtApp.provide('vuelidate', useVuelidate)
})