Skip to content

Commit

Permalink
Add range default value to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
wallslide committed Oct 2, 2020
1 parent a49a941 commit 055556a
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 6 deletions.
63 changes: 62 additions & 1 deletion docs/widgets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ DIALOG meetingTime

## Range

The `range` widget lets users choose a number between `min` and `max` values that the scriptwriter chooses. The scriptwriter can also choose an optional `unit` label.
The `range` widget lets users choose a number between `min` and `max` values that the scriptwriter chooses. The scriptwriter can also add an optional `default` value, and choose an optional `unit` label.
<br/>
<br/>

Expand Down Expand Up @@ -427,6 +427,67 @@ RUN minutesQuestion
```
</WizardMode>

<br/>

With default value:

<UpilBot>
```
DIALOG minutesQuestion
TEMPLATE range
{
formText: "Minutes",
min: 1,
max: 200,
default: 100,
unit: "分"
}
"How long did it take?"
>>minutes
/TEMPLATE
/DIALOG
RUN minutesQuestion
```
</UpilBot>

<FormMode hideScript>
```
DIALOG minutesQuestion
TEMPLATE range
{
formText: "Minutes",
min: 1,
max: 200,
default: 100,
unit: "分"
}
"How long did it take?"
>>minutes
/TEMPLATE
/DIALOG
RUN minutesQuestion
```
</FormMode>

<WizardMode hideScript>
```
DIALOG minutesQuestion
TEMPLATE range
{
formText: "Minutes",
min: 1,
max: 200,
default: 100,
unit: "分"
}
"How long did it take?"
>>minutes
/TEMPLATE
/DIALOG
RUN minutesQuestion
```
</WizardMode>

## Dynamic-list

The `dynamic-list` widget lets users enter items into a list. The variable is stored as an array in the `UpilInstance`. The scriptwriter can also pass an optional `placeholder` label.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@appsocially/userpil-core": "^1.1.10",
"@appsocially/vue-upil": "^2.4.2",
"@appsocially/vue-upil": "^2.4.4",
"core-js": "^3.6.5",
"vee-validate": "^3.3.7",
"vue": "^2.6.11",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
redux "^4.0.1"
vue-loader "^15.7.1"

"@appsocially/vue-upil@^2.4.2":
version "2.4.2"
resolved "https://registry.yarnpkg.com/@appsocially/vue-upil/-/vue-upil-2.4.2.tgz#c48146d2859e44a6d6e26f23400a043de8af9989"
integrity sha512-EUEb8o6CPzLgdaEqL8I/bLdsqR/Y5u0OzMhHwq/zr8SLpp94YSkDSP2C61EUFILfHunS2cyrrSuMcGK/VcDU7g==
"@appsocially/vue-upil@^2.4.4":
version "2.4.4"
resolved "https://registry.yarnpkg.com/@appsocially/vue-upil/-/vue-upil-2.4.4.tgz#a8cda2e8675ef74bede13646aac973ff1001e7b2"
integrity sha512-rIfXWHsMPbz/4aSB9D8VxyzwE7KnP0gbYQqT/UhNC8DJ2x5jczX9szGQBb77y19KlL5l0RDPqrDMa92eTHnNTw==
dependencies:
core-js "^3.6.4"
date-fns "^2.15.0"
Expand Down

0 comments on commit 055556a

Please sign in to comment.