Vue.component("node-group-selector", { props: ["v-cluster-id", "v-group"], mounted: function () { let that = this Tea.action("/clusters/cluster/groups/options") .post() .params({ clusterId: this.vClusterId }) .success(function (resp) { }) }, data: function () { return { groups: [], selectedGroup: this.vGroup, } }, methods: { selectGroup: function () { let that = this teaweb.popup("/clusters/cluster/groups/selectPopup?clusterId=" + this.vClusterId, { callback: function (resp) { that.selectedGroup = resp.data.group } }) }, addGroup: function () { let that = this teaweb.popup("/clusters/cluster/groups/createPopup?clusterId=" + this.vClusterId, { callback: function (resp) { that.selectedGroup = resp.data.group } }) }, removeGroup: function () { this.selectedGroup = null } }, template: `
{{selectedGroup.name}}  
[选择分组]   [添加分组]
` })