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时候不显示
我是 show1,默认是开启的(true),当你设置false我不显示!
我是 show2,默认是关闭的,当你设置show2的值为true,我会被显示!
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!