message handler for chatbot
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
37bb19d384
commit
8e7029f5fd
@ -12,6 +12,8 @@ export default {
|
|||||||
return {}
|
return {}
|
||||||
},
|
},
|
||||||
mounted: () => {
|
mounted: () => {
|
||||||
|
window.addEventListener('message', this.messageEventHandler, false)
|
||||||
|
|
||||||
let host = 'https://joinbot.tk/bot'
|
let host = 'https://joinbot.tk/bot'
|
||||||
let stylesheetdir = '/bot/assets/modules/channel-web/chat.css'
|
let stylesheetdir = '/bot/assets/modules/channel-web/chat.css'
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
@ -34,10 +36,15 @@ export default {
|
|||||||
}, 1500)
|
}, 1500)
|
||||||
},
|
},
|
||||||
beforeDestroy: () => {
|
beforeDestroy: () => {
|
||||||
|
window.removeEventListener('message', this.messageEventHandler, false)
|
||||||
|
|
||||||
document.getElementById('bp-widget').parentElement.removeChild(document.getElementById('bp-widget'))
|
document.getElementById('bp-widget').parentElement.removeChild(document.getElementById('bp-widget'))
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
messageEventHandler(event) {
|
||||||
|
console.log('Message handler')
|
||||||
|
console.log(event.message)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user