let triviaComponent = { props: { question: null }, created: function() { }, mounted: function() { this.submitTimer() }, data: function() { return { userInput: null, display: true, displayBtn: false, } }, methods: { submitTrivia: function() { liveSend({'answer': this.userInput}); // this.userInput = null // this.question = null this.display = false this.displayBtn = false }, submitTimer: function() { // display submit button setTimeout(() => {this.displayBtn = true}, 15000) }, }, watch: { question: function(val) { if (val) { setTimeout(() => {this.display = true}, 200) this.submitTimer() } } }, template: `
{{question.question}}

` }