the value asserted to be a ref.
an optional exception message to use if the check fails.
const element = useTemplateRef("my-template-ref");
// ^? Readonly<ShallowRef<HTMLElement | null>>
assertRef(element);
// element is now guaranteed to be a HTMLElement ref
MissingValueError if value is not set.
Assertion function to assert that a nullable Vue ref holds a non-null value. Typically used with template refs but any nullable ref can be used.
Throws MissingValueError if the ref holds
null
orundefined
, or the ref itself isnull
orundefined
.