- Full-Stack Vue.js 2 and Laravel 5
- Anthony Gore
- 74字
- 2021-07-02 19:57:19
Expressions
If a directive requires a value, it will be anexpression.
In the JavaScript language, expressions are small, evaluable statements that produce a single value. Expressions can be used wherever a value is expected, for example in the parenthesis of anifstatement:
if (expression) { ... }
The expression here could be any of the following:
- A mathematical expression, for examplex + 7
- A comparison, for examplev <= 7
- A Vuedataproperty, for examplethis.myval
Directives and text interpolations both accept expression values:
<p v-dir="someExpression">{{ firstName + " " + lastName }}</p>
推薦閱讀
- UML和模式應(yīng)用(原書第3版)
- JavaScript:Functional Programming for JavaScript Developers
- JavaScript+jQuery開發(fā)實(shí)戰(zhàn)
- SEO智慧
- Elastic Stack應(yīng)用寶典
- 零基礎(chǔ)學(xué)Java(第4版)
- Mastering Kali Linux for Web Penetration Testing
- JavaScript:Moving to ES2015
- 從Excel到Python:用Python輕松處理Excel數(shù)據(jù)(第2版)
- PHP 7+MySQL 8動(dòng)態(tài)網(wǎng)站開發(fā)從入門到精通(視頻教學(xué)版)
- Mastering C++ Multithreading
- C++反匯編與逆向分析技術(shù)揭秘(第2版)
- 小型編譯器設(shè)計(jì)實(shí)踐
- Python程序設(shè)計(jì)與算法基礎(chǔ)教程(第2版)(微課版)
- 寫給程序員的Python教程