0.1.31 • Published 11 months ago
hzim-ui v0.1.31
hzim_ui
This template should help get you started developing with Vue 3 in Vite.
安装
npm安装
npm install hzim-ui
yarn安装
yarn add hzim-ui
使用
目前仅支持vite+vue3+js项目
//main.js 引入组件库
import HZIMUI from 'hzim-ui'
import "hzim-ui/style.css"//引入样式文件
const app = createApp(App)
app.use(HZIMUI)
使用组件
<template>
<HzChatApp ref="charRef"></HzChatApp>
</template>
<script setup>
let chatRef = ref()
let options = relative({
url: "https://example.irenfang.cn",
MqttUrl: "http://example.irenfang.cn:28083",
token: 'iusghe9u.43hn9uihvs98ehr.590834g5',
userId: 'hz031',
name: '。',
avatar: '',
topic: `chat/user/${sessionStorage.getItem('userId')}/inbox`,
qos: 1
})
let MailList = ref([
{
name: 'zhangsan',
id: 'hz099',
avatar: ''
},
])
chatRef.value.initChatSys(options, MailList.value)
</script>
API
参数 | 说明 | 类型 | 可选值 | 默认值 | 是否必填 |
---|---|---|---|---|---|
options | 连接参数 | object | — | — | 是 |
MailList | 联系人列表 | Array | — | — | 是 |
options
参数 | 说明 | 类型 | 可选值 | 默认值 | 是否必填 |
---|---|---|---|---|---|
url | socket.io及后端服务地址 | string | — | — | 是 |
MqttUrl | mqtt地址 | string | — | — | 是 |
token | token | string | — | — | 否 |
userId | 用户ID | string | — | — | 是 |
name | 用户名 | string | — | — | 是 |
avatar | 头像 | string | — | — | 否 |
topic | mqtt会话主题 | string | — | — | 是 |
qos | 同mqtt qos | number | — | — | 否 |
MailList
参数 | 说明 | 类型 | 可选值 | 默认值 | 是否必填 |
---|---|---|---|---|---|
userId | 用户ID | string | — | — | 是 |
name | 用户名 | string | — | — | 是 |
avatar | 头像 | string | — | — | 否 |
Slot
Name | Description |
---|---|
— | - |
- | - |
Events
事件名称 | 说明 | 回调参数 |
---|---|---|
- | - | - |
Methods
名称 | 说明 | 类型 |
---|---|---|
initChatSys | 初始化聊天组件 | ^Function(options,MailList) => void |
0.1.31
11 months ago
0.1.30
11 months ago
0.1.29
11 months ago
0.1.28
11 months ago
0.1.27
11 months ago
0.1.26
11 months ago
0.1.25
11 months ago
0.1.24
11 months ago
0.1.23
11 months ago
0.1.22
11 months ago
0.1.21
11 months ago
0.1.20
11 months ago
0.1.19
11 months ago
0.1.18
11 months ago
0.1.17
11 months ago
0.1.16
11 months ago
0.1.15
11 months ago
0.1.14
11 months ago
0.1.13
11 months ago
0.1.11
11 months ago
0.1.10
11 months ago
0.1.9
11 months ago
0.1.8
11 months ago
0.1.7
11 months ago
0.1.6
11 months ago
0.1.5
11 months ago
0.1.4
11 months ago
0.1.3
11 months ago
0.1.2
11 months ago
0.1.1
11 months ago
0.1.0
11 months ago