Skip to content

Commit

Permalink
Merge pull request #933 from FlowFuse/docs-template-attrs
Browse files Browse the repository at this point in the history
 Docs: Clearer docs on ":" vs "{{ }}"
  • Loading branch information
Steve-Mcl authored Jun 1, 2024
2 parents 9b4c52b + 1ff1aca commit c3ee8fa
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/nodes/widgets/ui-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,23 @@ UI Template will parse different tags and render them into Dashboard. The availa
- `<script>` - Any JavaScript code in here will be executed when the widget is loaded. You can also [define a full VueJS component](#building-full-vue-components) here.
- `<style>` - Any CSS code in here will be injected into the Dashboard.

### Working with Variables

Any variables that you want to render into your `<template />` are done so in one of two ways:

::: v-pre
- **Attribute Binding** - Use `:` to bind a variable to an attribute. For example:

```html
<p :class="msg.payload">Hello World</p>
````

- **Text Interpolation** - Use `{{ }}` to interpolate a variable into the text of an element. For example:

```html
<p>Hello {{ msg.payload }}</p>
```

### Built-in Variables

You have access to a number of built-in variables in your `ui-template` node:
Expand Down

0 comments on commit c3ee8fa

Please sign in to comment.