Nuxt/test/fixtures/basic/pages/validate.vue

18 lines
286 B
Vue
Raw Normal View History

2016-12-20 17:26:46 +00:00
<template>
<h1>I am valid</h1>
</template>
<script>
export default {
2017-10-31 13:26:19 +00:00
validate({ query }) {
if (query.error) {
const err = new Error('Custom Error')
err.statusCode = parseInt(query.error) || 500
throw err
}
2016-12-20 17:26:46 +00:00
return Boolean(query.valid)
}
}
</script>