-1👍
Try binding a prop with the attribute. Using watch
to hook the prop.
<div id="g_id_onload"
:data-client-id="data_client_id">
</div>
<script>
new Vue({
el: '#app',
props: ['data_client_id'],
data: {},
watch: {
data_client_id: function(newVal, oldVal) { // watch it
console.log('Prop changed: ', newVal, ' | was: ', oldVal)
},
}
});
</script>
- [Vuejs]-Reset a const variable to its default value in vue
- [Vuejs]-Vue.js: Implementing client-side restful router with vue-router and a store
Source:stackexchange.com