element.unmount()
Use this method to unmount the Element instance from the DOM, but retain the instance so it can be mounted again. Below states the difference between this method and element.destroy():
element.unmount(): Unmounts but does not destroy the Element instance, it only removes it from the page. You can callelement.mount()again to mount.element.destroy(): Completely destroys the Element instance, releases resources, and cannot be used again.
Notes:
- Repeated unmounting: Calling
element.unmount()repeatedly will not cause an error, but the second call will have no effect.- Automatic unmounting: When
element.destroy()is called,element.unmount()is automatically called first.
Method signature
When calling this method, please use the following standard method signature format.
JavaScript
TypeScript
copy
element.unmount()Parameters
This method takes no input parameters.
Return value
This method does not return any value.