In my current project, I am developing a website utilizing PHP templates and jQuery. One of the features includes a table built with Vue:
let vuetablecomponent= new Vue({
components: { ManualTable },
}).$mount('[data-vue-app=manualtable]');
I am looking for a way to control the state of the Vue table externally. Right now, I am directly changing the props using JavaScript, like so:
vuetablecomponent.$children[0].aprop = 'propvalue'
Vue has warned me about the direct manipulation of props:
Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value.
Although technically I do not see it as an issue since the parent component is not a Vue component, and I want the value to be updated if the page is re-rendered by PHP, I am curious if there is a more elegant solution for this scenario.