Skip to content

Commit

Permalink
rewrite @input from component
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Sep 24, 2020
1 parent f3c8b44 commit 7c0246f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<content-editor
:value="topic"
:is-editing="isEditing"
@input="onInput"
@input-value="onInput"
@edit-done="onEditDone"
@edit-start="startEdit"
:maxlength="200"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<content-editor
:value="name"
:is-editing="isNameEditing"
@input="onNameInput"
@input-value="onNameInput"
@edit-done="onNameEditDone"
@edit-start="startNameEdit"
:maxlength="30"
Expand All @@ -14,7 +14,7 @@
<content-editor
:value="description"
:is-editing="isDesciptionEditing"
@input="onDesciptionInput"
@input-value="onDesciptionInput"
@edit-done="onDesciptionEditDone"
@edit-start="startDesciptionEdit"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<textarea-autosize
:value="value"
:class="$style.editor"
@input="onInput"
@input-value="onInput"
/>
<div
v-if="maxlength"
Expand Down Expand Up @@ -69,7 +69,7 @@ export default defineComponent({
const onInput = (payload: string) => {
length.value = Array.from(payload).length
context.emit('input', payload)
context.emit('input-value', payload)
}
return { content, isEmpty, onButtonClick, length, isExceeded, onInput }
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Main/MainView/MessageInput/MessageInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
:is-posting="isPosting"
@focus="onFocus"
@blur="onBlur"
@input="onInputText"
@input-value="onInputText"
@modifier-key-down="onModifierKeyDown"
@modifier-key-up="onModifierKeyUp"
@post-message="postMessage"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
placeholder="メッセージを送信"
rows="1"
:max-height="160"
@input="onInput"
@input-value="onInput"
@compositionupdate.native="onCompositionUpdate"
@before-input.native="onBeforeInput"
@keydown.native="onKeyDown"
Expand Down Expand Up @@ -91,7 +91,7 @@ export default defineComponent({
},
setup(props, context: SetupContext) {
const onInput = (value: string) => {
context.emit('input', value)
context.emit('input-value', value)
}
const textareaAutosizeRef = ref<{
Expand Down

0 comments on commit 7c0246f

Please sign in to comment.