[Bug Report][3.8.8] useRules composable broken
Environment
Vuetify Version: 3.8.8 Last working version: 3.8.5 Vue Version: 3.5.16 Browsers: Chrome 137.0.0.0 OS: Windows 10
Steps to reproduce
useRules() composable now accepts a function, and this isn't mentioned in the documentation
Expected Behavior
useRules() to still work as documented or documentation is updated
Actual Behavior
doesn't work
Reproduction Link
link to PR that seems to have caused it
I don't have a reproducible link, but after digging through the code a bit I realized this is more a change in functionality than a bug.
Basically, rules are meant to be used through the component's rules prop, instead of directly through the useRules composable.
Instead of the documented method:
<script setup lang="ts">
const rules = useRules()
</script>
<template>
<v-text-field
:rules="[rules.required]"
/>
</template>
You now can simply pass the name of the rule:
<template>
<v-text-field
:rules="['required']"
/>
</template>
Note that this does work with custom rules as well! Let me know if I should update the issue report to be more specific about the documentation being wrong as it appears this was intended.
Edit: And for rules that require arguments, looks like you can pass an array:
<template>
<v-text-field
:rules="[
'required',
['patttern', /^[\w\s\.-]+$/, 'Invalid name.']
]"
/>
</template>
Seems to be a duplicate of https://github.com/vuetifyjs/vuetify/issues/21477