# ByteDance Mini-Program
# ByteDance Example Mini-Program
# Creation Method
- Open ByteDance's Douyin Developer Tools
- Create a new Mini-Program
- Select the Mini-Program Capability Demo template
# Compatibility Status
- Libraries in
node_modulesneed to be built first using Build npm - For other compatibility details, refer to the detailed list below
# Known Issues
# Some APIs Are Not Implemented
- Solution: Use canIUse to check compatibility. For incompatible APIs, it is recommended to avoid using them or refer to the documentation to use the APIs provided by FinClip Mini-Program.
# slot-scope Is Not Supported
- Solution: Currently not supported, pending adaptation.
# Lifecycle Execution Timing Is Inconsistent
Note
- ByteDance Mini-Program lifecycle trigger order: Page onLoad -> Component created -> Component attached -> Page onShow
- FinClip Mini-Program lifecycle trigger order: Component created -> Component attached -> Page onLoad -> Page onShow
# Lifecycle Execution for Nested Components May Be Inconsistent
Example Code
<comp-a>
<comp-b/>
</comp-a>
Note
- For such a structure in a page, FinClip's approach considers comp-b as belonging to the page. Therefore, regardless of whether comp-a has slot nodes, comp-b will be created (triggering created and attached, but not ready), though it will not be rendered.
- ByteDance's approach creates comp-b only when rendering is required, meaning comp-b belongs to comp-a. If comp-a has no slot nodes, comp-b's lifecycle will not be executed.
# ttml Attribute Format Differs
<!-- Incorrect -->
<video id="myVideo" src={{src}}></video>
<!-- Correct -->
<!-- Must use quotes -->
<video id="myVideo" src="{{src}}"></video>
# setData Saving canvas or canvasContext Will Cause an Error
- Since canvas or canvasContext is not related to rendering, you can directly save it to the instance using
this.canvas = canvas.
# Style Files Do Not Support ID Selectors
- Solution: Currently not supported, pending adaptation.
# ByteDance Mini-Program Plugins and ByteDance Mini-Games Are Not Currently Supported
- Solution: Currently not supported, pending adaptation.