So I have a discount interface set up like this:
export interface Discount {
id: number
name: string
type: string
}
In my Vue.js app, I am using it on my prop in the following way:
export default class DiscountsEdit extends Vue {
@Prop({ default: () => {} }) discount!: Discount;
}
Currently, I am using the Twig template engine and passing an empty discount array into the Vue component. What I want is to automatically have the whole discount object with empty variable values like this:
id: 0
name: ''
type: ''
Is there a way to achieve this automatically on the Vue.js side, or do I have to define these values as empty before sending it to the Vue side?