Skip to content

Commit

Permalink
💅 Error into composition API (kodadot#6715)
Browse files Browse the repository at this point in the history
  • Loading branch information
vikiival authored Aug 15, 2023
1 parent c3ff15d commit 614a3b0
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions components/shared/Error.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,21 @@
</p>
</div>
</template>
<script lang="ts">
import { Component, Prop, Vue } from 'nuxt-property-decorator'
@Component({})
export default class Error extends Vue {
@Prop({ default: 500 }) readonly errorCode!: number
@Prop({ default: true }) readonly hasImg!: boolean
@Prop({ default: 'Indexer Error' }) errorTitle!: string
@Prop({ default: 'Indexer is not working properly.' }) errorSubtitle!: string
get imgSrc() {
return `https://http.cat/${this.$props.errorCode}`
<script setup lang="ts">
const props = withDefaults(
defineProps<{
errorCode: number
hasImg: boolean
errorTitle: string
errorSubtitle: string
}>(),
{
errorCode: 500,
hasImg: true,
errorTitle: 'Indexer Error',
errorSubtitle: 'Indexer is not working properly.',
}
}
)
const imgSrc = computed(() => `https://http.cat/${props.errorCode}`)
</script>

0 comments on commit 614a3b0

Please sign in to comment.