|
export default {
mounted() {
this.$root.myNewmethod = this.newMethod;
},
data() {
return {
cTemplate: function () {
return {
template: Vue.component("columnTemplate", {
template: `<div ref='grid2'>
<button v-on:click="procedimientoRechazo()">Click here</button>
</div>`,
data: function () {
return {
data: {},
};
},
methods: {
procedimientoRechazo: function () {
this.$root.myNewmethod.call("temp", this);
},
},
}),
};
},
};
},
methods: {
newMethod: function (templateInst) {
// The template instance can be accessed here as ‘templateInst’(returned as argument)
var country = templateInst.data.ShipCountry;
alert("ShipCountry is " + country);
},
},
}; |