You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of using `Vue.extend` to define our component, we create a class extending `Vue` and decorate it using the `@Component` decorator from the `vue-class-component` package (which was re-exported from the `vue-property-decorator` package).
464
467
465
468
Properties are defined by prefixing instance variables with the `@Prop()` decorator from the `vue-property-decorator` package.
469
+
Because the `--strictPropertyInitialization` option is on, we need to tell TypeScript that Vue will initialize our properties by appending a `!` to them.
470
+
This tells TypeScript "hey, relax, someone else is going to assign this property a value."
466
471
467
472
Regular instance variables, such as `enthusiasm` in our example, are automatically made available for data binding to the template, just as if they had been defined in the `data` field.
468
473
Note that all variables must be set to a value other than `undefined` for the binding to work.
0 commit comments