Last active
February 7, 2021 01:43
-
-
Save Maxim-Mazurok/f6fa6709d03f0efe55c736252cac2863 to your computer and use it in GitHub Desktop.
Vue Props issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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