Last active
March 5, 2019 23:43
-
-
Save ais-one/1b6c00d320ced754405a615ecb7bf01c to your computer and use it in GitHub Desktop.
WC2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<loading-blocker :loading="loading"></loading-blocker> | |
<h1>Test</h1> | |
<button @click="block">Click To Turn On Blocker This Cannot Be Clicked When Blocker Is Up</button> | |
</div> | |
</template> | |
<script> | |
import '@/vcx-loading-blocker.js' | |
const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); | |
export default { | |
data: () => ({ loading: false }), | |
methods: { | |
async block () { | |
this.loading = true | |
await delay(2000) | |
this.loading = false | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment