Skip to content

Commit

Permalink
Add 'props-update' event dispatching
Browse files Browse the repository at this point in the history
  • Loading branch information
7-zete-7 committed Sep 28, 2024
1 parent b957699 commit 15b7798
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Vue/assets/dist/render_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ class default_1 extends Controller {
this.props = shallowReactive({ ...props });
watch(this.props, (props) => {
this.propsValue = toRaw(props);
this.dispatchEvent('props-update', {
componentName: this.componentValue,
props: this.props,
app: this.app,
});
}, { flush: 'post' });
}
connect() {
Expand Down
5 changes: 5 additions & 0 deletions src/Vue/assets/src/render_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ export default class extends Controller<Element & { __vue_app__?: App<Element> }
this.props,
(props) => {
this.propsValue = toRaw(props);
this.dispatchEvent('props-update', {
componentName: this.componentValue,
props: this.props,
app: this.app,
});
},
{ flush: 'post' }
);
Expand Down

0 comments on commit 15b7798

Please sign in to comment.