13 lines
343 B
TypeScript
13 lines
343 B
TypeScript
import type { Ref } from 'vue'
|
|
//import SlInput from '@shoelace-style/shoelace/dist/components/input/input.js'
|
|
|
|
|
|
export function setFieldValidation(field: Ref<any>, errorMessage: string = '') {
|
|
// Set validation on a field
|
|
if (!field.value) {
|
|
return
|
|
}
|
|
field.value?.setCustomValidity(errorMessage)
|
|
field.value?.reportValidity()
|
|
}
|