1👍
✅
Just like you would type any other variable in TypeScript, using the variable: type
syntax:
export default {
data: () => ({
firstName: '',
firstNameRules: [
(value: string) => {
if (value?.length > 3) return true
return 'First name must be at least 3 characters.'
},
],
}),
}
Source:stackexchange.com