bbs-package-vue2

0.0.42 • Public • Published

手动初始化

Vue.use(chat)

自动初始化

Vue.use(chat,{
    connect:{
        groupId:'1632925345397391361',
        id:'1',
        isBannedToPost:true,
        nickName:'我是昵称',
        loadUrl: 'http://192.168.31.168:7000/#/',
        language:'zh',
        mode:'cp'
    },
    logo:{
        showLogo:true,
        drag:true
    }
})

this.$chat.initChat({
    connect:{
        groupId:'1632925345397391361',
        id:'1',
        isBannedToPost:true,
        nickName:'我是昵称',
        loadUrl: 'http://192.168.31.168:7000/#/',
        language:'zh',
        mode:'cp'
    },
    logo:{
        showLogo:true,
        drag:true
    }
})
// 调用方法前确保此回调返回true
this.$chat.onStatusReady(e=>{
    console.log(e,'状态')
})

hooks 可在仓库等单独抽离时使用

import {useBBsPackage} from "bbs-package-vue2";
const bbsChat = useBBsPackage()
bbsChat.onStatusReady(e=>{
    console.log(e,'状态')
})

/bbs-package-vue2/

    Package Sidebar

    Install

    npm i bbs-package-vue2

    Weekly Downloads

    0

    Version

    0.0.42

    License

    none

    Unpacked Size

    555 kB

    Total Files

    10

    Last publish

    Collaborators

    • cxiaobaiy