0

I am researching about making a Vue component using class and found out this library

https://github.com/kaorun343/vue-property-decorator#Provide

In the example as below:

import { Vue, Component, Prop } from 'vue-property-decorator'

@Component
export default class YourComponent extends Vue {
  @Prop(Number) readonly propA: number | undefined
  @Prop({ default: 'default value' }) readonly propB!: string
  @Prop([String, Boolean]) readonly propC: string | boolean | undefined
}

What is the !: meaning in the code

propB!: string

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
Geoffrey Lee
  • 387
  • 2
  • 7
  • 15

0 Answers0