Skip to content

Commit b69da21

Browse files
committed
The Vue.js tutorial I watched makes me think that there is a convention to always put the data, methods, and computed sections first in the export default block.
1 parent 771c460 commit b69da21

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/components/Inputs/DocumentUpload/DocumentUpload.vue

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@
1111
export default {
1212
name: 'DocumentUpload',
1313
props: ['constraints', 'init'],
14-
watch: {
15-
input() {
16-
// if there is a change, emit it.
17-
this.$emit('valueChanged', this.input);
18-
},
14+
data() {
15+
return {
16+
selectedFile: null,
17+
};
1918
},
2019
methods: {
2120
onFileSelected(event) {
@@ -31,15 +30,16 @@ export default {
3130
return this.a + this.b;
3231
},
3332
},
34-
data() {
35-
return {
36-
selectedFile: null,
37-
};
38-
},
3933
mounted() {
4034
if (this.init) {
4135
this.selectedFile = this.init;
4236
}
4337
},
38+
watch: {
39+
input() {
40+
// if there is a change, emit it.
41+
this.$emit('valueChanged', this.input);
42+
},
43+
}
4444
};
4545
</script>

0 commit comments

Comments
 (0)