mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
commit
93dd08593d
32
README.md
32
README.md
@ -609,21 +609,6 @@ The `c-choose` directive, in combination with the directives `c-when` and `c-oth
|
||||
|
||||
_Applied as an attribute:_
|
||||
```html
|
||||
<c-choose>
|
||||
<c-when test="myVar === 'A'">
|
||||
<div>A</div>
|
||||
</c-when>
|
||||
<c-when test="myVar === 'B'">
|
||||
<div>B</div>
|
||||
</c-when>
|
||||
<c-otherwise>
|
||||
<div>Something else</div>
|
||||
</c-otherwise>
|
||||
<c-choose>
|
||||
```
|
||||
|
||||
_Applied as an element:_
|
||||
```html
|
||||
<c-choose>
|
||||
<div c-when="myVar === 'A'">
|
||||
A
|
||||
@ -637,6 +622,21 @@ _Applied as an element:_
|
||||
<c-choose>
|
||||
```
|
||||
|
||||
_Applied as an element:_
|
||||
```html
|
||||
<c-choose>
|
||||
<c-when test="myVar === 'A'">
|
||||
<div>A</div>
|
||||
</c-when>
|
||||
<c-when test="myVar === 'B'">
|
||||
<div>B</div>
|
||||
</c-when>
|
||||
<c-otherwise>
|
||||
<div>Something else</div>
|
||||
</c-otherwise>
|
||||
<c-choose>
|
||||
```
|
||||
|
||||
### Shorthand conditionals
|
||||
|
||||
Shorthand conditionals allow for conditional values inside attributes or wherever expressions are allowed. Shorthand conditionals are of the following form:
|
||||
@ -1311,7 +1311,7 @@ __Answer__: Raptor Templates started out using an XML parser. This required that
|
||||
|
||||
__Question:__ _What is the recommended directory structure for templates and "partials"_
|
||||
|
||||
__Answer__: Your templates should be organized just like all other JavaScript modules. You should put your templates right next to the code that refers to them. That is, do not create a separate "templates" directory. For a sample Express app that uses Raptor Templates, please see [raptorjs-express-app](https://github.com/raptorjs3/samples/tree/master/raptorjs-express-app).
|
||||
__Answer__: Your templates should be organized just like all other JavaScript modules. You should put your templates right next to the code that refers to them. That is, do not create a separate "templates" directory. For a sample Express app that uses Raptor Templates, please see [raptor-templates-express-app](https://github.com/raptorjs3/raptor-samples/tree/master/raptor-templates-express-app).
|
||||
|
||||
<hr>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user