0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

v-else

0
Posted at

先ほどはtrueの時の表示だけですが、
falseの場合の表示もさせてみます。

ここで使うのが
v-else

<script src="https://cdn.jsdelivr.net/npm/vue@2.6.12/dist/vue.js"></script>
<div id="app">
<p v-if="ok">OK</p>
<p v-else>NG</p>
</div>
new Vue({
  el: '#app',
   data: {
   ok: false
 }
})

20210506-201222.png

v-elseはv-ifの直後に使うこと。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?