File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,9 @@ npm install --save vue-advanced-chat
74
74
75
75
# Using yarn
76
76
yarn add --save vue-advanced-chat
77
+
78
+ # Using CDN
79
+ < script src=
" https://cdn.jsdelivr.net/npm/[email protected] /dist/vue-advanced-chat.min.js" ></script
>
77
80
```
78
81
79
82
If you want to send mp3 audio messages, you may need to install ` lamejs ` inside your project:
@@ -86,7 +89,7 @@ npm install lamejs --save
86
89
87
90
## Usage
88
91
89
- You can import it as a custom component:
92
+ #### You can import it as a custom component:
90
93
91
94
``` javascript
92
95
< template>
@@ -116,6 +119,27 @@ You can import it as a custom component:
116
119
< / script>
117
120
```
118
121
122
+ #### Or if you used CDN import:
123
+
124
+ ``` javascript
125
+ < template>
126
+ < vue- advanced- chat
127
+ : current- user- id= " currentUserId"
128
+ : rooms= " rooms"
129
+ : messages= " messages"
130
+ / >
131
+ < / template>
132
+
133
+ < script>
134
+ export default {
135
+ mounted () {
136
+ document .querySelector (' vue-advanced-chat' ).rooms = []
137
+ document .querySelector (' vue-advanced-chat' ).messages = []
138
+ }
139
+ }
140
+ < / script>
141
+ ```
142
+
119
143
### Important notes
120
144
121
145
` vue-advanced-chat ` component is performance oriented, hence you have to follow specific rules to make it work properly.
@@ -780,3 +804,7 @@ Your help is always appreciated :rocket:
780
804
## License
781
805
782
806
This project is licensed under [ MIT License] ( http://en.wikipedia.org/wiki/MIT_License )
807
+
808
+ ```
809
+
810
+ ```
You can’t perform that action at this time.
0 commit comments