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

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.

主站蜘蛛池模板: 托克托县| 永兴县| 长宁区| 日土县| 南平市| 静安区| 阿拉尔市| 黄骅市| 和静县| 双城市| 济宁市| 夏河县| 饶阳县| 永福县| 凤翔县| 苏尼特左旗| 海丰县| 古田县| 中超| 呼玛县| 监利县| 佛坪县| 南木林县| 临邑县| 阜康市| 宁陕县| 无棣县| 凉城县| 金湖县| 栖霞市| 奇台县| 安丘市| 黔东| 双峰县| 庐江县| 于田县| 垦利县| 普定县| 开化县| 叶城县| 石屏县|