Browse Source

fix: missing lodash dependency and support nested properties in list-table

dev
hechang27 5 months ago
parent
commit
5d71d1e3b1
  1. 2
      bun.lock
  2. 2
      package.json
  3. 7
      packages/base/data/list-table.vue

2
bun.lock

@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
"core-js": "^3.47.0",
"dayjs": "^1.11.19",
"element-plus": "2.13.0",
"lodash-es": "^4.17.23",
"vue": "^3.5.26",
"vue-class-component": "^8.0.0-0",
"vue-router": "^4.6.4",
@ -20,6 +21,7 @@ @@ -20,6 +21,7 @@
"xterm-addon-fit": "^0.8.0",
},
"devDependencies": {
"@types/lodash-es": "^4.17.12",
"@vitejs/plugin-legacy": "^7.2.1",
"@vitejs/plugin-vue": "^6.0.3",
"@vue/cli-plugin-babel": "~5.0.9",

2
package.json

@ -94,6 +94,7 @@ @@ -94,6 +94,7 @@
"core-js": "^3.47.0",
"dayjs": "^1.11.19",
"element-plus": "2.13.0",
"lodash-es": "^4.17.23",
"vue": "^3.5.26",
"vue-class-component": "^8.0.0-0",
"vue-router": "^4.6.4",
@ -104,6 +105,7 @@ @@ -104,6 +105,7 @@
"xterm-addon-fit": "^0.8.0"
},
"devDependencies": {
"@types/lodash-es": "^4.17.12",
"@vitejs/plugin-legacy": "^7.2.1",
"@vitejs/plugin-vue": "^6.0.3",
"@vue/cli-plugin-babel": "~5.0.9",

7
packages/base/data/list-table.vue

@ -28,12 +28,12 @@ @@ -28,12 +28,12 @@
show-overflow-tooltip
:formatter="(row: any, column: any, value: any) => formatter(row, column, value, item)"
>
<template v-if="item.slot" #default="scope">
<slot :name="item.code" :row="scope.row"></slot>
<template v-if="item.slot" #default="{ row }">
<slot :name="item.code" :row="row"></slot>
</template>
<template v-if="item.dict" #default="{ row }">
{{ formatterByDist(item.dict, row[item.code]) }}
{{ formatterByDist(item.dict, lodash.get(row, item.code)) }}
</template>
</el-table-column>
</el-table>
@ -58,6 +58,7 @@ import { useStore } from "vuex"; @@ -58,6 +58,7 @@ import { useStore } from "vuex";
import { reactive, onMounted, ref, watch, onUpdated } from "vue";
import { useI18n } from "vue3-i18n";
import { TableColumn } from "noob-mengyxu";
import * as lodash from "lodash-es";
// import { PageExample } from "noob-mengyxu";
const { t } = useI18n();
const { state } = useStore();

Loading…
Cancel
Save