You can simply write your data into this.product.extensions.your-extension
Shopware will automatically write it to the database when you save the product (Autoloading might need to be active for this to work I’m not sure). This worked for me:
methods: {
// This is the @change Method on my Input
updateData(){
this.myExtension.option = this.selectedOption;
this.product.extensions.myExtension = this.myExtension;
}
},
created(){
if(!this.product.extensions.myExtension){
this.myExtension = this.myExtensionRepository.create(Shopware.Context.api);
this.myExtension.productId = this.product.id;
}else{
this.myExtension = this.product.extensions.myExtension;
this.selectedOption = this.product.extensions.myExtension.option;
}
}