|
|
@@ -7,7 +7,7 @@
|
|
|
<div class="table__content_list_row" v-for="(item, index) in data" :key="`svvhbct-${index}`">
|
|
|
<div v-for="(t, i) in columns" :key="`svvhbctr-${i}`" :style="{ flexBasis }" :class="`table__content__list_item_${type}`">
|
|
|
<slot :name="t.prop" :scope="item">
|
|
|
- <span>{{ get(item, t.prop) }}</span>
|
|
|
+ <span>{{ getter(item, t.prop) }}</span>
|
|
|
</slot>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -16,7 +16,7 @@
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
import { computed } from 'vue';
|
|
|
- import _ from 'lodash';
|
|
|
+ import { get, isNil } from 'lodash-es';
|
|
|
|
|
|
let props = withDefaults(
|
|
|
defineProps<{
|
|
|
@@ -40,9 +40,9 @@
|
|
|
return Math.fround(100 / props.columns.length) + '%';
|
|
|
});
|
|
|
|
|
|
- function get(o, p) {
|
|
|
- const d = _.get(o, p);
|
|
|
- return _.isNil(d) ? props.defaultValue : d === '' ? props.defaultValue : d;
|
|
|
+ function getter(o, p) {
|
|
|
+ const d = get(o, p);
|
|
|
+ return isNil(d) ? props.defaultValue : d === '' ? props.defaultValue : d;
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|