Skip to content

Commit b3ac3d7

Browse files
committed
(demo) clean imports
1 parent a9501c2 commit b3ac3d7

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

demo/src/ChatContainer.vue

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,9 @@ import * as storageService from '@/database/storage'
8181
import { parseTimestamp, formatTimestamp } from '@/utils/dates'
8282
import logoAvatar from '@/assets/logo.png'
8383
84-
// import { register } from 'vue-advanced-chat'
84+
import { register } from 'vue-advanced-chat'
8585
// import { register } from './../../dist/vue-advanced-chat.es.js'
86-
import { register } from './../../src/lib/index.js'
87-
import styles from './../../src/styles/index.scss'
86+
// import { register } from './../../src/lib/index.js'
8887
register()
8988
9089
export default {
@@ -137,6 +136,7 @@ export default {
137136
{ name: 'deleteRoom', title: 'Delete Room' }
138137
],
139138
messageSelectionActions: [{ name: 'deleteMessages', title: 'Delete' }],
139+
// eslint-disable-next-line vue/no-unused-properties
140140
styles: { container: { borderRadius: '4px' } },
141141
templatesText: [
142142
{
@@ -166,18 +166,20 @@ export default {
166166
},
167167
168168
mounted() {
169-
if (import.meta.env.MODE === 'development') {
170-
this.addCss()
171-
}
169+
this.addCss()
170+
172171
this.fetchRooms()
173172
firebaseService.updateUserOnlineStatus(this.currentUserId)
174173
},
175174
176175
methods: {
177-
addCss() {
178-
const style = document.createElement('style')
179-
style.innerHTML = styles
180-
this.$refs.chatWindow.shadowRoot.appendChild(style)
176+
async addCss() {
177+
if (import.meta.env.MODE === 'development') {
178+
const styles = await import('./../../src/styles/index.scss')
179+
const style = document.createElement('style')
180+
style.innerHTML = styles.default
181+
this.$refs.chatWindow.shadowRoot.appendChild(style)
182+
}
181183
},
182184
resetRooms() {
183185
this.loadingRooms = true

0 commit comments

Comments
 (0)