fix data render

This commit is contained in:
ann 2022-04-27 11:31:16 +08:00
parent b07bf993ce
commit 7f09933ff1
1 changed files with 3 additions and 2 deletions

View File

@ -57,7 +57,7 @@
<script>
import { getNamespaceYaml, postNamespace, putNamespace } from '@/api/one-class-page/virtualMachine'
import { set, get } from 'lodash'
import { set, get, pull } from 'lodash'
export default {
data() {
@ -107,7 +107,8 @@ export default {
getNamespaceYaml(this.$route.query.name).then(res => {
this.formData.name = get(res, 'metadata.name')
this.formData.description = get(res, 'metadata.annotations')['field.cattle.io/description']
// this.formData.name = get(res, 'annotations["node.kubesphere.io/cpu-limits"]')
this.formData.labels = Object.keys(get(res, 'metadata.labels')).map(e => ({ key: e, value: res.metadata.labels[e] }))
this.formData.annotations = pull(Object.keys(get(res, 'metadata.annotations')), 'field.cattle.io/description').map(e => ({ key: e, value: res.metadata.annotations[e] }))
})
}
},