Reputation: 359
I want to use ref to create a class . It can be used as a class instance which can be called by .
in my ts file
export default declare class Cropper {
....
}
in my vue3 file
const cropper =ref<Cropper||undefined||null>()
Upvotes: 2
Views: 911
Reputation: 222474
The syntax for |
union types in TypeScript isn't the same as ||
(logical OR) in JavaScript.
It should be:
const cropper = ref<Cropper|undefined|null>()
Upvotes: 2