2.6.5 • Published 8 months ago
lowcoder-sdk v2.6.5
lowcoder-sdk
Usage
yarn:
yarn add lowcoder-sdknpm:
npm install lowcoder-sdkIntegrate Lowcoder's app/module into existing app page
- Publish your app/module in Lowcoder.
- Set the app/module's access privilege as public.
- Add code in your existing app as below.
Import style
import "lowcoder-sdk/dist/style.css";For react app:
import { LowcoderAppView } from "lowcoder-sdk";
<LowcoderAppView appId="{YOUR_APPLICATION_ID}" />;LowcoderViewProps
| Name | Type | Description | Default value |
|---|---|---|---|
| appId | string | The app's id in Lowcoder. Required! | -- |
| baseUrl | string | Lowcoder's api base url | -- |
| onModuleEventTriggered | (eventName: string) => void | Triggered when module's custom event is triggered. Works only when the app is a module. | -- |
| onModuleOutputChange | (output: any) => void | Triggered when module's outputs change. Works only when the app is a module. | -- |
Invoke module methods
import { useRef } from "ref";
import { LowcoderAppView } from "lowcoder-sdk";
function MyExistingAppPage() {
const appRef = useRef();
return (
<div>
<LowcoderAppView appId={YOUR_APPLICATION_ID} ref={appRef} />;
<button onClick={() => appRef.current?.invokeMethod("some-method-name")}>
Invoke method
</button>
</div>
);
}For vanilla js:
import { bootstrapAppAt } from "lowcoder-sdk";
const node = document.querySelector("#my-app");
async function bootstrap() {
const instance = await bootstrapAppAt(YOUR_APPLICATION_ID, node);
// set module inputs
instance.setModuleInputs({ input1: "xxx", input2: "xxx" });
// invoke module methods
instance.setModuleInputs({ input1: "xxx", input2: "xxx" });
// listen module event trigger
instance.on("moduleEventTriggered", (eventName) => {
console.info("event triggered:", eventName);
});
// listen module output change
instance.on("moduleOutputChange", (data) => {
console.info("output data:", data);
});
}2.6.1
9 months ago
2.6.0
10 months ago
2.6.3
9 months ago
2.6.2
9 months ago
2.5.5
10 months ago
2.4.17
11 months ago
2.5.2
11 months ago
2.5.1
11 months ago
2.5.4
10 months ago
2.4.16
1 year ago
2.5.3
11 months ago
2.4.15
1 year ago
2.6.5
8 months ago
2.6.4
9 months ago
2.4.14
1 year ago
2.4.13
1 year ago
2.4.12
1 year ago
2.4.5
1 year ago
2.4.4
1 year ago
2.4.10
1 year ago
2.4.11
1 year ago
2.4.7
1 year ago
2.4.6
1 year ago
2.4.8
1 year ago
2.4.3
2 years ago
2.4.2
2 years ago
2.4.1
2 years ago
2.4.0
2 years ago
2.4.0-beta-5
2 years ago
2.4.0-beta-3
2 years ago
2.4.0-beta-4
2 years ago
2.4.0-beta-2
2 years ago
2.4.0-beta-1
2 years ago
2.4.0-beta
2 years ago
2.3.2
2 years ago
2.3.4
2 years ago
2.3.3
2 years ago
2.3.1
2 years ago
2.3.0
2 years ago
2.1.11
2 years ago
2.1.10
2 years ago
2.1.9
2 years ago
2.1.6
2 years ago
2.1.7
2 years ago
2.1.2
2 years ago
2.1.1
2 years ago
2.1.4
2 years ago
2.1.3
2 years ago
2.1.5
2 years ago
2.1.0
2 years ago
0.0.41
2 years ago
0.0.40
2 years ago