Skip to content

Commit 0e43e36

Browse files
committed
Fixed the reactivity of the JigTextarea component
1 parent 65360bb commit 0e43e36

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

resources/js/JigComponents/JigTextarea.vue

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
<template>
2-
<textarea class="border-gray-300 rounded-md shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50" v-model="value" ref="txt"></textarea>
2+
<textarea :value="modelValue" @input="onInput" class="border-gray-300 rounded-md shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50" ref="txt"></textarea>
33
</template>
44

55
<script>
66
export default {
77
name: "JigTextarea",
8-
props: ['value'],
9-
emits: ['input'],
8+
props: ['modelValue'],
9+
emits: ['update:modelValue'],
1010
model: {
11-
prop: 'value',
12-
event: 'input'
11+
prop: 'modelValue',
12+
event: 'update:modelValue'
1313
},
1414
methods: {
1515
focus() {
1616
this.$refs.txt.focus()
17+
},
18+
onInput(e) {
19+
console.log(e);
20+
this.$emit('update:modelValue',e.target.value)
1721
}
1822
}
1923
}

0 commit comments

Comments
 (0)