【发布时间】:2018-06-19 01:45:43
【问题描述】:
如果我有一个像这样的TodoList 组件:
<template>
<div>
<InputText
v-model="newTodoText"
placeholder="New todo"
@keydown.enter="addTodo"
/>
...
</template>
如何更改我的InputText 组件以将文本发送回该组件?
<template>
<input
type="text"
class="input"
>
</template>
addTodo方法存在,只是不知道如何将InputText中的文字链接回父组件。
【问题讨论】:
标签: vue.js vuejs2 vue-component