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

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.

主站蜘蛛池模板: 慈利县| 清涧县| 黔西| 宁陕县| 金川县| 商城县| 平乡县| 枣庄市| 富宁县| 桃园市| 上蔡县| 柳江县| 吕梁市| 南澳县| 固原市| 焉耆| 乐亭县| 乐山市| 深水埗区| 化隆| 新疆| 伊春市| 海林市| 中宁县| 扬中市| 余干县| 济宁市| 永定县| 来安县| 大同市| 宜川县| 云阳县| 靖西县| 攀枝花市| 韶关市| 宿迁市| 宁明县| 江源县| 福海县| 英吉沙县| 仙游县|