You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
loading/src/exampleLoading.riot

39 lines
1016 B

2 years ago
<example-loading>
<div class="example m-top-5">
<label class="field-label">
<input class="field-choice" type="checkbox" name="radio" value="true" onchange={ () => { handleSwitch() } }>
<span class="field-switch"></span>
</label>
2 years ago
<div class="panel" if={ state.isActive }>
2 years ago
<div class="panel__body">
2 years ago
<tiny-loading active={ state.isActive }></tiny-loading>
2 years ago
</div>
</div>
</div>
<script>
export default {
state: {
2 years ago
isActive: false
2 years ago
},
/**
* toggle active to show panel and tiny-loading
*
*/
handleSwitch()
{
2 years ago
if (this.state.isActive === true) {
this.state.isActive = false
2 years ago
} else {
2 years ago
this.state.isActive = true
2 years ago
}
this.update()
}
}
</script>
</example-loading>