Vue.js learning record: using the v-if directive in elements and templates

陈政宽~
Release: 2017-06-28 15:37:46
Original
1193 people have browsed it

This article mainly introduces you to the relevant information about the use of v-if instructions in elements and templates in Vue.js learning records. The article gives detailed sample codes for your reference and learning. I believe it will be of some use to you. For reference learning value, friends who need it can take a look below.

This article mainly introduces to you the relevant content about the use of v-if instructions in elements and templates of Vue.js. It is shared for your reference and learning. Let’s take a look at the detailed introduction:

The syntax is relatively simple, just enter the code directly:


     

在Vue.js中,当判断语句为true,可以显示信息,当为false时候不显示

Copy after login


true is Openstate, false is closed state.

#If you are interested, you can try changing show2: false from false to true. You can see two messages, as follows:

In Vue.js, when the judgment statement is true, the information can be displayed, and when it is false, it will not be displayed.

I am show1, which is enabled by default (true). When you set false, I will not display it!

I am show2, which is turned off by default. When you set the value of show2 to true, I will be displayed!

Summarize

The above is the detailed content of Vue.js learning record: using the v-if directive in elements and templates. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!