Skip to content

Instantly share code, notes, and snippets.

@Maxim-Mazurok
Last active February 7, 2021 01:43
Show Gist options
  • Save Maxim-Mazurok/f6fa6709d03f0efe55c736252cac2863 to your computer and use it in GitHub Desktop.
Save Maxim-Mazurok/f6fa6709d03f0efe55c736252cac2863 to your computer and use it in GitHub Desktop.
Vue Props issue
<template>
<!-- Correct Usage: -->
<app-bar :tabs="tabs" />
<!-- Incorrect Usage (still compiles/builds without any warnings): -->
<app-bar :crabs="tabs" />
</template>
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import AppBar from "@/components/AppBar.vue";
@Component({
components: {
AppBar,
},
})
export default class Home extends Vue {}
</script>
<template>
<div>
<v-tab v-for="tab in tabs" :key="tab">
{{ tab }}
</v-tab>
</div>
</template>
<script lang="ts">
import { Component, Vue, Prop } from "vue-property-decorator";
@Component
export default class AppBar extends Vue {
@Prop({ required: true }) readonly tabs!: string[];
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment