@ray-js/panel-base-sdk
v1.1.4
Published
Tuya Mini App Panel Base SDK
Downloads
52
Readme
English | 简体中文
@ray-js/panel-base-sdk
Ray Panel Mini App Base JS SDK
Installation
$ npm install @ray-js/panel-base-sdk
# or
$ yarn add @ray-js/panel-base-sdk
# or
$ pnpm add @ray-js/panel-base-sdk
Usage
Fully use
import { kit, hooks, utils, service } from '@ray-js/panel-base-sdk';
const { I18N } = kit;
// Never use hooks.useDpState, which will cause the eslint rule to fail to detect
const { useDpState } = hooks;
const data = utils.parseJSON('{}');
service.getAssetHostname().then(data => {
console.lo('data: ', data);
});
Use on demand
import { useDpState, useNetwork } from '@ray-js/panel-base-sdk/lib/hooks';
import { parseJSON } from '@ray-js/panel-base-sdk/lib/utils';
import { getAssetHostname } from '@ray-js/panel-base-sdk/lib/service';
import { I18N } from '@ray-js/panel-base-sdk/lib/kit';