File tree 2 files changed +10
-2
lines changed
packages/content/templates
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 2
2
<textarea
3
3
ref =" textarea"
4
4
v-model =" file"
5
- @keyup.stop =" onType"
6
5
@keydown.tab.exact.prevent =" onTabRight"
7
6
@keydown.tab.shift.prevent =" onTabLeft"
8
7
@compositionstart.prevent =" isInComposition = true"
@@ -32,13 +31,18 @@ export default {
32
31
this .$refs .textarea .focus ()
33
32
},
34
33
file () {
34
+ this .onType ()
35
35
this .$emit (' input' , this .file )
36
36
}
37
37
},
38
38
methods: {
39
39
onType () {
40
40
const el = this .$refs .textarea
41
- el .style .height = el .scrollHeight + ' px'
41
+
42
+ el .style .height = ' auto'
43
+ this .$nextTick (() => {
44
+ el .style .height = el .scrollHeight + ' px'
45
+ })
42
46
},
43
47
onTabRight (event ) {
44
48
if (this .isInComposition ) {
Original file line number Diff line number Diff line change @@ -98,7 +98,11 @@ export default {
98
98
}
99
99
100
100
.nuxt-content-editor {
101
+ box-sizing : border-box ;
102
+ display : block ;
101
103
width : 100% ;
102
104
padding : 8px ;
105
+ overflow : hidden ;
106
+ resize : none ;
103
107
}
104
108
</style >
You can’t perform that action at this time.
0 commit comments