mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-18 03:35:17 +00:00
e7cc2757c3
Co-authored-by: Alexander Lichter <manniL@gmx.net>
22 lines
425 B
Vue
22 lines
425 B
Vue
<template>
|
|
<h1>I am valid</h1>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
validate ({ query }) {
|
|
return new Promise((resolve, reject) => {
|
|
setTimeout(() => {
|
|
if (query.error) {
|
|
const err = new Error('Custom Error')
|
|
err.statusCode = parseInt(query.error) || 500
|
|
reject(err)
|
|
} else {
|
|
resolve(Boolean(query.valid))
|
|
}
|
|
}, 500)
|
|
})
|
|
}
|
|
}
|
|
</script>
|