官术网_书友最值得收藏!

The note editor

Now that we have our app running, let's add the text editor. We will use a simple textarea element and the v-model directive we saw in Chapter 1, Getting Started with Vue.

Create a section element and put the textarea inside, then add the v-model directive bound to our content property:

<!-- Main pane -->
<section class="main">
  <textarea v-model="content"></textarea>
</section>

Now, if you change the text ;inside the note editor, the value of content should automatically chance in the devtools.

The v-model directive is not limited to text inputs. You can also use it in other form elements, such as checkboxes, radio buttons, or even custom components, as we will see later in the book.

主站蜘蛛池模板: 陆川县| 西宁市| 顺义区| 化德县| 西畴县| 宁南县| 大渡口区| 元朗区| 德江县| 丰镇市| 黎川县| 福贡县| 神池县| 龙里县| 嘉祥县| 闽侯县| 韩城市| 西和县| 绥滨县| 格尔木市| 平原县| 平武县| 唐河县| 克拉玛依市| 子洲县| 光泽县| 昆明市| 澄江县| 耿马| 宜良县| 宜黄县| 绥滨县| 怀来县| 彰化市| 阳新县| 无为县| 大余县| 廉江市| 昌平区| 云和县| 余江县|