I have registered a property through the CSS.registerProperty method. The problem is that when I load the same component a DOMException is thrown because such a property already exists.
I am looking for a way to know if there is a getter for properties or similar.
Run in a vue3 component.
onMounted( () => {
try {
window.CSS.registerProperty({
name: "--num",
syntax: "<integer>",
inherits: false,
initialValue: 0,
});
} catch (error) {
if(error instanceof DOMException){
console.log(error)
}
}
}
That's the error -> DOMException: Failed to execute 'registerProperty' on 'CSS': The name provided has already been registered.