rewording
This commit is contained in:
1 parent
2342619cd0
commit
0487b39737
1 file changed
+5
-5
+5
-5
@@ -1,30 +1,30 @@
|
|||||||
# Attributes
|
# Attributes
|
||||||
|
|
||||||
| dj-attr | Used to dynamically assign attributes using Django template variables. |
|
| dj-attr | Dynamically assign attributes using Django template variables. |
|
||||||
|----------------|---------------------------------------------------------------------------------------|
|
|----------------|---------------------------------------------------------------------------------------|
|
||||||
| Syntax | `<element dj-attr="attribute1;value1~attribute2;value2~attribute3;value3"></element>` |
|
| Syntax | `<element dj-attr="attribute1;value1~attribute2;value2~attribute3;value3"></element>` |
|
||||||
| Example Input | `<div dj-attr="class;my-class~id;my-id"></div>` |
|
| Example Input | `<div dj-attr="class;my-class~id;my-id"></div>` |
|
||||||
| Example Output | `<div class="{{ my-class }}" id="{{ my-id }}"></div>` |
|
| Example Output | `<div class="{{ my-class }}" id="{{ my-id }}"></div>` |
|
||||||
|
|
||||||
| dj-block | Used to replace the element with Django block tags. |
|
| dj-block | Replace the element with Django block tags. |
|
||||||
|----------------|-----------------------------------------------------|
|
|----------------|-----------------------------------------------------|
|
||||||
| Syntax | `<element dj-block="blockname">Content</element>` |
|
| Syntax | `<element dj-block="blockname">Content</element>` |
|
||||||
| Example Input | `<div dj-block="content">Content</div>` |
|
| Example Input | `<div dj-block="content">Content</div>` |
|
||||||
| Example Output | `{% block content %}Content{% endblock %}` |
|
| Example Output | `{% block content %}Content{% endblock %}` |
|
||||||
|
|
||||||
| dj-command | Used to replace the element with a Django template command. |
|
| dj-command | Replace the element with a Django template command. |
|
||||||
|----------------|-------------------------------------------------------------|
|
|----------------|-------------------------------------------------------------|
|
||||||
| Syntax | `<element dj-command="command"></element>` |
|
| Syntax | `<element dj-command="command"></element>` |
|
||||||
| Example Input | `<div dj-command="url 'index'"></div>` |
|
| Example Input | `<div dj-command="url 'index'"></div>` |
|
||||||
| Example Output | `{% url 'index' %}` |
|
| Example Output | `{% url 'index' %}` |
|
||||||
|
|
||||||
| dj-for | Used to replace the element with a Django template for loop. |
|
| dj-for | Replace the element with a Django template for loop. |
|
||||||
|----------------|--------------------------------------------------------------|
|
|----------------|--------------------------------------------------------------|
|
||||||
| Syntax | `<element dj-for="item in list">Content</element>` |
|
| Syntax | `<element dj-for="item in list">Content</element>` |
|
||||||
| Example Input | `<div dj-for="item in list"><p>Hello</p></div>` |
|
| Example Input | `<div dj-for="item in list"><p>Hello</p></div>` |
|
||||||
| Example Output | `{% for item in list %}<p>Hello</p>{% endfor %}` |
|
| Example Output | `{% for item in list %}<p>Hello</p>{% endfor %}` |
|
||||||
|
|
||||||
| dj-for-wrap | Used to wrap the element within a Django template for loop. |
|
| dj-for-wrap | Wrap the element within a Django template for loop. |
|
||||||
|----------------|-------------------------------------------------------------|
|
|----------------|-------------------------------------------------------------|
|
||||||
| Syntax | `<element dj-for-wrap="item in list">Content</element>` |
|
| Syntax | `<element dj-for-wrap="item in list">Content</element>` |
|
||||||
| Example Input | `<div dj-for-wrap="item in list">Content</div>` |
|
| Example Input | `<div dj-for-wrap="item in list">Content</div>` |
|
||||||
|
|||||||
Reference in new issue
Block a user