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

Loading…
Cancel
Save