mio-U-M
6/3/2018 - 7:03 AM

computedで切り替えるクラス

computedで切り替えるクラス

<div id="app">
  <p class="text-basic" v-bind:class="classObject">CLASS CHANGE SAMPLE</p>
  <input type="text" v-model="activeClass"/>
  <p class="explain">type below strings</p>
  <ul class="typelist">
    <li>"0":text color change into red.</li>
    <li>"1":text color change into blue.</li>
    <li>"2":text color change into green.</li>
    <li>"-":add underline to text.</li>
    <li>".":change background color into gray.</li>
  </ul>
</div>