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

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.

主站蜘蛛池模板: 马鞍山市| 依兰县| 中阳县| 屏山县| 六盘水市| 车险| 郑州市| 民丰县| 昂仁县| 新巴尔虎左旗| 晋江市| 城固县| 于田县| 婺源县| 广水市| 眉山市| 宁南县| 南昌市| 荥阳市| 麟游县| 乌苏市| 格尔木市| 靖江市| 太和县| 磐石市| 聂荣县| 安阳市| 吉林省| 康保县| 稷山县| 蓬溪县| 奇台县| 三都| 汨罗市| 澳门| 昌乐县| 安仁县| 连山| 凤冈县| 阜阳市| 兰西县|