Skip to content

Commit

Permalink
doc(html): precise the usage of parentheses for expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
finetjul committed Jan 28, 2025
1 parent b34a4b2 commit 6833ffb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/vitepress/guide/tutorial/html.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ We expose all Vuetify components in ***trame***. As an example, let's look at ho
```javascript
// Somewhere in javascript
const currentSuffix = "lbs";
const myWeight = 28.0;
const myWeight = 28.0; // `let myWeight` or `ref(28.0)` ?
```
```html
<!-- Somewhere in html -->
Expand All @@ -40,7 +40,7 @@ Exposing Vuetify in Python was accomplished by making a few syntax changes.

2. Strings, ints, floats, and booleans used to set attributes are assigned as normal like `vuetify.VTextField(label="myLabel")` for the `"myLabel"` String.

3. Variables used to set attributes are surrounded by parenthesis like `vuetify.VTextField(label=("myLabel",))`. The comma is used to provide an initial value like `vuetify.VTextField(label=("myLabel", "Initial Label"))`.
3. Expressions or state variables used to set attributes are assigned as a String in a tuple (i.e. surrounded by parenthesis) like `vuetify.VTextField(label=("myLabel",))`. The comma enforces the usage of a tuple. An optional 2nd parameter is used to provide an initial value like `vuetify.VTextField(label=("myLabel", "Initial Label"))`.

4. Vuetify implicitly sets boolean properties. For example, if something is to be `disabled`, then one simply writes disabled. In our Python implementation, this is done explicitly like `vuetify.VTextField(disabled=True)`.

Expand All @@ -51,8 +51,8 @@ Given these rules, we can recreate the JavaScript/HTML text field example in ***
```python
field = VTextField(
label="Weight",
v_model=("myWeight",28),
suffix=("currentSuffix","lbs"),
v_model=("myWeight", 28),
suffix=("currentSuffix", "lbs"),
)
```

Expand Down

0 comments on commit 6833ffb

Please sign in to comment.