Home > Article > Web Front-end > How to use curly braces in vue
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 }}
双花括号的练习 双花括号:执行表达式,将表达式的结果 输出到当前调用的元素的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 vueVue-router components pass parameters to each other methodThe 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!