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

18 lines
287 B
Vue
Raw Normal View History

2016-12-20 17:26:46 +00:00
<template>
<h1>I am valid</h1>
</template>
<script>
export default {
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>