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

Event listener

We now want to remove thecontractedclass automatically when the user clicks theMorebutton. To do this job, we'll use thev-ondirective, which listens to DOM events with aclickargument.

The value of thev-ondirective can be an expression that assignscontractedtofalse.

index.html:

<p class="about">
  <h3>About this listing</h3>
  <p v-bind:class="{ contracted: contracted }">{{ about }}</p>
  <button class="more" v-on:click="contracted = false">+ More</button>
</p>
主站蜘蛛池模板: 濮阳县| 石嘴山市| 安西县| 玉田县| 合水县| 瑞昌市| 曲水县| 苗栗市| 美姑县| 西充县| 浏阳市| 安达市| 珠海市| 新昌县| 泾阳县| 滕州市| 南陵县| 大同县| 海丰县| 新竹市| 赞皇县| 靖西县| 九龙坡区| 达孜县| 古丈县| 水富县| 锦屏县| 陇川县| 色达县| 恩平市| 建昌县| 瓮安县| 卢湾区| 巴楚县| 正阳县| 镇安县| 香格里拉县| 兴文县| 新源县| 济南市| 平凉市|