Vue.component("http-cache-policy-selector", { props: ["v-cache-policy"], mounted: function () { let that = this Tea.action("/servers/components/cache/count") .post() .success(function (resp) { that.count = resp.data.count }) }, data: function () { let cachePolicy = this.vCachePolicy return { count: 0, cachePolicy: cachePolicy } }, methods: { remove: function () { this.cachePolicy = null }, select: function () { let that = this teaweb.popup("/servers/components/cache/selectPopup", { callback: function (resp) { that.cachePolicy = resp.data.cachePolicy } }) }, create: function () { let that = this teaweb.popup("/servers/components/cache/createPopup", { height: "26em", callback: function (resp) { that.cachePolicy = resp.data.cachePolicy } }) } }, template: `
{{cachePolicy.name}}    
[选择已有策略]     [创建新策略]
` })