Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove val attribute BS #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions src/components/TextareaAutosize.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<template>
<textarea
:style="computedStyles"
v-model="val"
:value="value"
@input="$emit('input', $event.target.value)"
@focus="resize"
></textarea>
</template>
Expand Down Expand Up @@ -35,8 +36,6 @@ export default {
},
data () {
return {
// data property for v-model binding with real textarea tag
val: null,
// works when content height becomes more then value of the maxHeight property
maxHeightScroll: false,
height: 'auto'
Expand Down Expand Up @@ -65,12 +64,8 @@ export default {
}
},
watch: {
value (val) {
this.val = val
},
val (val) {
value () {
this.$nextTick(this.resize)
this.$emit('input', val)
},
minHeight () {
this.$nextTick(this.resize)
Expand Down Expand Up @@ -109,9 +104,6 @@ export default {
return this
}
},
created () {
this.val = this.value
},
mounted () {
this.resize()
}
Expand Down