The front-end {{}} syntax judges whether the value is null or undefined (implementation using the ternary operator)

Application Scenario

I assigned the value of data.value in other places, here is the echo, to judge whether it is or null

grammar

{ { 变量名 !== null ? 要赋的值 : 条件都不满足时要赋的值 }}

Practical application scenarios

{
    
    {
    
     data.value !== null ? data.value : '-' }}

Guess you like

Origin blog.csdn.net/xiaohua616/article/details/131835586