<template>
<span>
<button v-on:click="handleClick($event)">RowData</button>
<button v-on:click="handleClick($event)">Btn2</button>
</span>
</template>
export default {
name: "MyEmployeeTemplate",
data() {},
methods: {
handleClick: function (args) {
var data = JSON.stringify(this.data);
alert(data);
},
},
}; |
<e-column
field="CustomerID"
headerText="Customer ID"
width="220"
:template="customerIDHeaderTemplate"
></e-column>
<script>
export default Vue.extend({
components: {
MyEmployeeTemplate,
},
data: () => {
return { },
customerIDHeaderTemplate: function (e) {
return {
template: MyEmployeeTemplate,
};});
</script> |
created() {
bus.$on("getdata", (data) => {
alert(data);
});
}, |
<template>
<span>
<div
class="customer"
v-for="customer in data['CustomerID']"
v-bind:key="customer">
<button v-on:click="handleClick($event)" class="favorite">
{{ customer }}
</button>
</div>
</span>
</template>
<script>
import { bus } from "/src/main.js";
export default {
data() {},
methods: {
handleClick: function (args) {
var data = JSON.stringify(this.data);
bus.$emit("getdata", data);
},
},
};
</script> |
<template>
<span>
<div
class="customer"
v-for="customer in data['CustomerID']"
v-bind:key="customer">
<button v-on:click="handleClick($event)" class="favorite">
{{ customer }}
</button>
</div>
</span>
</template> |