# Alipay Mini-Program
# Alipay Sample Mini-Program
# Creation Method
- Open the Alipay Mini-Program Developer Tools
- Create a new Mini-Program
- Select the Alipay platform
- Select the Mini-Program Sample template
- Fill in the project name and project path
# Compatibility Status
- Libraries in
node_modulesneed to be processed using Build npm first - Extension Components are under development for compatibility
- For other compatibility details, refer to the detailed list below
# Known Issues
# Some APIs Not Implemented
- Solution: Use canIUse to check compatibility. For incompatible APIs, it is recommended to avoid using them or consult the documentation to use the APIs provided by the FinClip Mini-Program.
# Lottie Component Not Supported
- Solution: Currently not supported, pending adaptation.
# Slot Usage Inconsistency
- slot-scope and $slots are not supported.
- Solution: Currently not supported, pending adaptation.
- Elements inside the
<slot></slot>tag will not be rendered under any circumstances.
- Solution: Currently not supported, pending adaptation.
# Page events and Component rootEvents Not Supported
- Solution: Currently not supported, pending adaptation.
# Page Configuration Options onOptionMenuClick and onTitleClick Not Supported
- Solution: Currently not supported, pending adaptation.
# Component's $page Not Supported
- Solution: Currently not supported, pending adaptation.
# Component's deriveDataFromProps Differs from Alipay
Note
- The value during the initial trigger is the default value, not the value passed from the parent component.
- It will also trigger when
setDatais called but thedataorpropsvalues remain unchanged.
# Component's didUpdate Differs from Alipay
Note
The parameters are not the data before modification, and the trigger timing might be incorrect.
# Inconsistent Lifecycle Execution for Nested Components
Sample Code
<comp-a>
<comp-b/>
</comp-a>
Note
- For a structure like this in a page, the FinClip approach considers
comp-bas belonging to the page. Therefore, regardless of whethercomp-ahas a slot node,comp-bwill be created (triggeringcreatedandattachedbut notready), though it will not be rendered on the page. - The Alipay approach creates components only if they need to be rendered, meaning
comp-bbelongs tocomp-a. Ifcomp-ahas no slot node,comp-b's lifecycle will not be executed.
# axml Attribute Format Differs
<!-- Incorrect -->
<video id="myVideo" src={{src}}></video>
<!-- Correct -->
<!-- Quotes must be used -->
<video id="myVideo" src="{{src}}"></video>
# Data Binding Parsing Differs
Non-expressions are not supported.
<!-- Incorrect --> <view style="{{ height: activeTab === 1 ? 'auto' : 0 }}"></view> <!-- Correct --> <view style="height:{{ activeTab === 1 ? 'auto' : 0 }}"></view>Template strings are not supported.
<!-- Incorrect --> <view style="{{`width: ${size}; height: ${size};`}}"></view> <!-- Correct --> <view style="width: {{size}};height: {{size}}"></view> <!-- Incorrect --> <view style="{{(src ? `background-image: url('${src}'); background-color: transparent` : '')}}"></view> <!-- Correct --> <view style="{{src ? 'background-image: url('+ src +'); background-color: transparent' : ''}}"></view>Objects are not supported for the
styleattribute.<!-- Incorrect --> <view style="{{{width:size,heigth:size}}}"></view> <!-- Correct --> <view style="width: {{size}};height: {{size}}"></view>
# Mixin Does Not Support Merging Alipay Lifecycles
Note
The Alipay lifecycles (onInit, deriveDataFromProps, didMount, didUpdate, didUnmount, onError) defined in a Mixin will not be merged with those defined in the custom component. The lifecycle methods defined in the custom component will be used directly. Lifecycles defined within lifetimes will follow the normal merging logic.
# background-image Does Not Support Local Paths
- Solution: Currently not supported, pending adaptation. Alternatively, use the
imagecomponent.
# dataset Does Not Support Setting Objects
- Solution: Currently not supported, pending adaptation. Alternatively, serialize the data using
JSON.stringifyand parse it usingJSON.parsewhen needed.
# Inconsistent Behavior When Passing Data to class via props
Note
- If data is passed to a
classviaprops, this data might be affected by style isolation. For example, if the data passed viapropsishot, the actual class rendered on the page might be something likeclass-prefix--hot. - It is recommended to use
externalClassesinstead.
# createSelectorQuery Behavior Differs
Note
my.createSelectorQuery() does not support searching directly across the entire page and cannot penetrate components. It needs to be changed to this.createSelectorQuery(), or .in(this) needs to be called multiple times to restrict the search to the corresponding component. Alternatively, add a class to the parent level of the component and use the >>> selector in the selector query to find element nodes inside the component.
# pickerview Component Requires Width and Height Settings for Proper Rendering
Note
In Alipay Mini-Programs, pickerview can render without setting width and height. In FinClip Mini-Programs, width and height must be set; otherwise, it will render with a width and height of 0.
# input Component maxlength Default Value
Note
In FinClip Mini-Programs, if maxlength of the input component is bound to undefined, it will be converted to 0, preventing input. If maxlength does not need to be set, do not set it to undefined.
# scroll-view Component Flex Layout Usage Differs
Note
If scroll-view needs to control the layout of internal elements via flex, enable-flex must be enabled on the scroll-view.
# canvas Creation Method Differs
Note
The canvas creation method used in Alipay Mini-Programs corresponds to the legacy version in FinClip Mini-Programs. It needs to be changed to the new version Canvas API.
# Usage of Third-Party Libraries
Note
Alipay does not require Build npm, so files within node_modules can be directly referenced during development. In FinClip Mini-Programs, Build npm must be performed first, which means only the main file specified by the npm package can be referenced.
# Custom Component Rendering Method
- Because the actual method of creating node elements differs, Alipay custom components do not create a real DOM node as a wrapper. This allows flex layout to directly control elements inside and outside the component. FinClip Mini-Programs create a real DOM node, which isolates the component, preventing direct control of internal and external elements using flex layout.
# Alipay Mini-Program Plugin Functionality Not Currently Supported
- Solution: Currently not supported, pending adaptation.