whalecloud-dxp-page-builder-react-native
v1.0.4
Published
whalecloud-dxp-page-builder
Downloads
146
Maintainers
Readme
Page Builder
This section delineates the utilization of the SDK and elucidates it through an illustrative instance.
- This section is essential for educational purposes.
Installation
- Embed the npm package reference into your project's
package.json
configuration, like so:
"dependencies": {
"whalecloud-dxp-page-builder-react-native": "^1.0.0",
}
- Execute
yarn add whalecloud-dxp-page-builder-react-native --registry=https://verdaccio.digchan.info/
in the primary project directory to integrate the newfound dependency. - Recompile and initiate your React Native application.
Importing
Invoke DXPPageBuilder within the constructor
method of APP.js
, referencing the exemplary project whalecloudDxpSDKReactNativeExample
:
Import snippet:
import { DXPPageBuilder } from 'whalecloud-dxp-page-builder-react-native';
Example of initialization:
constructor(props) {
super(props);
const DXP_PAGE_BUILDER_BASE_URL = 'Your PB URL address';
//设置pbUrl
DxpPageBuilder.init(DXP_PAGE_BUILDER_BASE_URL);
//设置token
DXPPageBuilder.setToken('Your PB token')
//设置对应点击监听
DXPPageBuilder.setOnPbItemClickListener()
}
Basic Usage
1. Employing as an independent page
Directly navigate to the PageBuilder page through the navigation mechanism:
const pageCode = "Your PB page code";
DXPPageBuilder.launchPageBuild('pageCode')