momocow / node-cq-websocket

A Node SDK for developing QQ chatbots based on WebSocket, which is depending on CoolQ and CQHTTP API plugin.

Home Page:https://cq-websocket.js.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support Vue.js as a Vue plugin

momocow opened this issue · comments

Vue plugin reference

Then the SDK can be used to develope a Vue app (or Vue components), with this.$bot or syntaxes like this.

I was inspired by this vue plugin, but its API shows that it can only hold a WebSocket instance across the whole app.
It seems somewhat inconvenience for certain scenarios 🤔

I found that I don't like to make the bot instance singleton after trying the vue-native-websocket API.
So just leave those who wants to integrate with Vue do the mixin themselves.