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

2
package.json

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

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

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

Loading…
Cancel
Save