1. The role of brackets1.1 Square brackets [ ]When the attribute name is enclosed in square brackets, the right side is assigned the value of the expression <br /> If the attribute does not have square brackets, the right side is assigned a string <div class="red">red</div> //The class name here is red <div [class]="red">red</div> //The class name here is blue, which means that the right side of the square brackets is an expression //In the component red: string = "blue"; 1.2 Parentheses ( )Parentheses are used for event binding, which triggers an event on an element and the bound method responds, such as <div (click)="go()">gogo</div> //Put the event in the parentheses //Component class go() { //expression... } 1.3 Curly Braces { { }}Use curly braces { {expression}} This method is called interpolation and can be placed in the template <div>{{good}}</div> //<div>Hello</div> //Component class good: string = "Hello"; 1.4 String variables |
<<: Briefly describe the difference between MySQL and Oracle
>>: How to modify the location of data files in CentOS6.7 mysql5.6.33
Table of contents Effect display Component Settin...
Mini Program Custom Scroll-View Scroll Bar Withou...
Table of contents front end According to the abov...
Table of contents 1. Operator 1.1 Arithmetic oper...
Preface This article mainly introduces the method...
This article shares the specific code of Vue to a...
Table of contents Introduction Instructions Actua...
Regular expressions are often used to search and ...
After entering the Docker container, if you exit ...
Preface I have always wanted to know how a SQL st...
Table of contents summary Overall process front e...
Because I have a database tutorial based on SQL S...
Html semantics seems to be a commonplace issue. G...
Problem: The overflow of the auto-increment ID in...
1. What is a calculated attribute? In plain words...