Browse Source

增加value属性

wangqin
刘朋 8 months ago
parent
commit
85d66d9cc6
  1. 10
      ruoyi-ui/src/views/JiHeExpressway/components/Card1/index.vue

10
ruoyi-ui/src/views/JiHeExpressway/components/Card1/index.vue

@ -11,7 +11,7 @@
<span>{{ item.label }}: </span>
<span>
<slot :name="`form-${item.key}`" :data="cardData">
{{ getValue(item.key) }}{{ item.suffix }}
{{ getValue(item) }}{{ item.suffix }}
</slot>
</span>
</p>
@ -106,8 +106,12 @@ export default {
};
},
methods: {
getValue(key) {
return pathGet(this.cardData, key) ?? "-";
getValue(item) {
let value = pathGet(this.cardData, item.key) ?? "-";
if (item.value) {
value = item.value(this.cardData);
}
return value;
},
onClick() {

Loading…
Cancel
Save