1.0.6 • Published 1 year ago

inwu-uikit v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

使用指南

在 vue3 中使用

1、安装 inwu-uikit

npm run inwu-uikit

2、导入样式

import 'inwu-uikit/style.css';

3、导入 inwu-uikit

import MicronatureInstance from 'inwu-uikit';

4、准备容器

<div id="inwu-container" style="width:1920px; height:1080px"></div>

5、初始化

onMounted(async () => {
  let MN = new MicronatureInstance({
    url: 'https://******/',
    username: '***',
    password: '***'
  });
  await MN.init();
  MN.mountElement('inwu-container', 'home');
});

例:在react中使用

1、安装inwu-uikit

npm run inwu-uikit

2、导入样式

import 'inwu-uikit/style.css';

3、导入inwu-uikit并初始化

import MicronatureInstance from 'inwu-uikit';
async function init() {
    let MN = new MicronatureInstance  ({
        url: 'https://******/',
        username: '***',
        password: '***'
    });
    await MN.init();
    let el = document.querySelector('.Home')
    MN.mountElement(el, 'home');
}
function App() {
  return (<div className="Home"></div>);
}
export default App;

实例说明

let MN = new MicronatureInstance(initConfig)

MethodDescription
MN.init()初始化配置
MN.login(username: string, password: string)登录 参数: 1、用户名 2、密码
MN.mountComponent(id | HTMLElement, moduleName)加载指定模块的文件 参数:1、元素 id 或元素 2、模块名
MN.unmountComponent()销毁当前模块
MN.setTheme(‘dark’ | ‘light’)切换主题 参数:深色浅色
MN.setLang(‘zh’ | ‘en’)切换语言 参数:中文英文
MN.setProject(projectId)切换项目参数:项目 id
PropertyDescription
MN.lang: string当前语言
MN.theme: string当前主题样式
MN.userInfo: UserInfo当前主题样式
MN.projectList: ProjectInfo[]项目列表
MN.currentProject: ProjectInfo当前项目
MN.el: string | HTMLElement当前项目
MN.config: InitConfig当前配置信息

类型/参数说明

initConfig: 初始化配置 | Param | Description | | :--- | :---------- | | initConfig.lang: string | 语言 参数:‘zh’ | ‘en’ 默认:‘zh’ | initConfig.url: string | api 接口 | initConfig.themeStyle: string | 主题样式 参数:‘dark’ | ‘light’ 默认:‘dark | initConfig.username: string | 用户名 | initConfig.password: string | 密码

moduleName: 模块名,选择要加载的模块 | Param | Description | | :--- | :---------- | | home: string | 首页 | area: string | 空间页 | device: string | 设备 | distribution: string | 分配 | group: string | 群组 | scene: string | 场景 | linkage: string | 联动 | schedule: string | 日程 | orderList: string | 订单列表 | orderManage: string | 订单管理 | control: string | 监控、控制页 | energy: string | 能耗页

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago