“VUE 3 Setup Requisis TypeScript” Code-Antworten

VUE 3 Setup Requisis TypeScript

import FlashInterface from '@/interfaces/FlashInterface';
import { PropType } from 'vue';

export default {
    props: {
        message: {
            type: Object as PropType<FlashInterface>,
            required: true
        }
    },
    setup(props, context) {
  		// Stuff
    }
};
DeuxAlpha

Requisiten vue TypeScript

<script>
// you need npm i vue-property-decorator
import { Component, Prop, Vue } from 'vue-property-decorator'
@Component
export default class HelloWorld extends Vue {
  @Prop() readonly msg!: string
  @Prop({default: 'John doe'}) readonly name: string
  @Prop({required: true}) readonly age: number
  @Prop(String) readonly address: string
  @Prop({required: false, type: String, default: 'Developer'}) readonly job: string
}
</script>
Bright Barracuda

Ähnliche Antworten wie “VUE 3 Setup Requisis TypeScript”

Fragen ähnlich wie “VUE 3 Setup Requisis TypeScript”

Weitere verwandte Antworten zu “VUE 3 Setup Requisis TypeScript” auf TypeScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen