How use update:content?

I’m creating a custom component, but I can’t update it by clicking on something in the component. The documentation simply says:

// Inside your component methods you can do
this.$emit(“update:content”, {
/*… */
});

update:content

  • Type: Object

  • Available for Section and Element

  • Available in Editor only

  • See also Update content

And when I enter the page, there’s nothing written.

In my code, I’m doing it like this:

alterarVisualizacao(modo) {
// Usar update:content conforme documentação WeWeb
this.$emit(‘update:content’, {
…this.content,
visualizacao: modo
});
},

However, without success, and the curious thing is that in editor mode the button works, but in preview and deploy mode it doesn’t.

link full code:

I don’t think you want to use this method. You probably need something else. What are you trying to achieve?

It was a button on the component, but pressing it didn’t update the component.

But I managed, thanks.