<template lang="pug">
.deployment-hwow()
deployment-hwow-selector.selector.mb-3(
ref="selector"
:status="'scheduled'"
:env="selectedService"
v-on:changeEnv="selectedService($event)"
:showpostactions="true"
)
<label>i am label {{selectedService}}</label>
</template>
这是指以下vue文件
<template>
v-layout(row align-center justify-center v-if="!readonly")
// select env
v-flex.max(shrink)
v-select(
label="Hwow Services"
:items="hwowServiceOptions"
v-model="selectedService"
</template>
<script>
data: () => {
return {
selectedService: null,
}
}
computed: {
hwowServiceOptions: state => state.deployment.requesthwowServiceOptions,
}
watch: {
selectedService: function() {
const env = this.hwowServiceOptions.findIndex(e => e ===
this.selectedService);
const envs = env !== -1 ? [ env ] : null;
const filters = {
...this.filters,
selectedEnvironments: envs,
};
this.$store.commit('deployment/setFilters', filters);
this.$emit('changeEnv', this.selectedService);
},