Skip to content

Commit d8956b8

Browse files
committed
Rename beforeDestroy to beforeUnmount
1 parent 17eae52 commit d8956b8

File tree

5 files changed

+19
-9
lines changed

5 files changed

+19
-9
lines changed

examples/questionnaire/Example.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,11 @@
7777
7878
export default {
7979
name: 'example',
80+
8081
components: {
8182
FlowForm
8283
},
84+
8385
data() {
8486
return {
8587
submitted: false,
@@ -103,7 +105,7 @@
103105
required: true,
104106
placeholder: 'Start typing here...'
105107
}),
106-
new QuestionModel({
108+
new QuestionModel({
107109
id: 'multiple_choice_image',
108110
tagline: "Let's take it one step further...",
109111
title: 'Tell us what is your favorite social network hangout.',
@@ -220,7 +222,7 @@
220222
path_b: 'path_b'
221223
}
222224
}),
223-
new QuestionModel({
225+
new QuestionModel({
224226
id: 'path_a',
225227
title: 'Excellent choice! 🥳',
226228
content: 'Press enter or use the continue button for the final submit screen.',
@@ -253,12 +255,15 @@
253255
]
254256
}
255257
},
258+
256259
mounted() {
257260
document.addEventListener('keyup', this.onKeyListener)
258261
},
259-
beforeDestroy() {
262+
263+
beforeUnmount() {
260264
document.removeEventListener('keyup', this.onKeyListener)
261265
},
266+
262267
methods: {
263268
onKeyListener($event) {
264269
// We've overriden the default "complete" slot so
@@ -324,7 +329,7 @@
324329
325330
return data
326331
}
327-
},
332+
}
328333
}
329334
</script>
330335

src/components/FlowForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@
202202
this.checkTimer()
203203
},
204204
205-
beforeDestroy() {
205+
beforeUnmount() {
206206
document.removeEventListener('keydown', this.onKeyDownListener)
207207
document.removeEventListener('keyup', this.onKeyUpListener, true)
208208
window.removeEventListener('beforeunload', this.onBeforeUnload)

src/components/FlowFormQuestion.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
this.$refs.qanimate.addEventListener('animationend', this.onAnimationEnd)
172172
},
173173
174-
beforeDestroy() {
174+
beforeUnmount() {
175175
this.$refs.qanimate.removeEventListener('animationend', this.onAnimationEnd)
176176
},
177177

src/components/QuestionTypes/LongTextType.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,32 @@
2626
*/
2727
2828
import BaseType from './BaseType.vue'
29-
import LanguageModel from '../../models/LanguageModel'
3029
import { QuestionType } from '../../models/QuestionModel'
3130
import TextareaAutosize from 'vue-textarea-autosize/src/components/TextareaAutosize'
3231
3332
export default {
3433
extends: BaseType,
34+
3535
name: QuestionType.LongText,
36+
3637
components: {
3738
TextareaAutosize
3839
},
40+
3941
data () {
4042
return {
4143
canReceiveFocus: true
4244
}
4345
},
46+
4447
mounted() {
4548
window.addEventListener('resize', this.onResizeListener)
4649
},
47-
beforeDestroy() {
50+
51+
beforeUnmount() {
4852
window.removeEventListener('resize', this.onResizeListener)
4953
},
54+
5055
methods: {
5156
onResizeListener() {
5257
this.$refs.input.resize()

src/components/QuestionTypes/MultipleChoiceType.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
this.addKeyListener()
7474
},
7575
76-
beforeDestroy() {
76+
beforeUnmount() {
7777
this.removeKeyListener()
7878
},
7979

0 commit comments

Comments
 (0)