Home  >  Article  >  Web Front-end  >  How to use curly braces in vue

How to use curly braces in vue

php中世界最好的语言
php中世界最好的语言Original
2018-04-14 17:37:295520browse

This time I will show you how to use vue’s curly braces. What are the precautions for using vue’s curly braces? The following is a practical case. Let’s take a look. .



 
 
 {{}}的使用
 
 
   

  

{{msg}}

  

{{cart.brand}}

   

 3 + 5 = {{ 3 + 5 }}

 

   

Code:


 
 
 双花括号的练习
 
 
   

 双花括号:执行表达式,将表达式的结果 输出到当前调用的元素的innerHTML中  

 

{{msg}}   

三目运算3>5:{{3>5?"对":"错"}}

  

逻辑运算3>5 && 2>1:{{3>5 && 2>1}}

  

{{!hasMore}}

  

{{totalNum>count?"大于":"小于"}}

 

   

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

Detailed explanation of SPA single-page application in vue


Vue-router components pass parameters to each other method


The above is the detailed content of How to use curly braces in vue. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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