The base library 1.7.0 and later versions of the Mini Program support the custom component function. By calling my.canIUse('component')
, you can check whether the custom component function can be used in the current version.
The custom component function can abstract the functional modules that need to be reused into custom components, so that they can be reused in different pages.
Note: The custom components have undergone major changes in basic library 1.14.0 and later versions.
- Added
onInit
andderiveDataFromProps
Life cycle function. ref
can be used to Obtain custom component instances.