el-plus-crud 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@
9
9
  <ElPlusFormBtn v-if="Object.keys(formConfig?.formDesc || {}).length" type="primary" icon="ele-Search" :loading="loading" :desc="{ label: '查询', on: { click: handelSearch }, size }" />
10
10
  <ElPlusFormBtn v-if="Object.keys(formConfig?.formDesc || {}).length" :desc="{ label: '重置', on: { click: handelReset }, size }" />
11
11
  <ElPlusTableSettingColumn ref="settingColumnRef" v-if="tbName" :tbName="tbName" :column="column || []" :size="size" />
12
- <ElPlusFormBtn type="primary" v-if="exportConf" :desc="{ label: '导出Excel', size, disabled: exportConf?.disabled, mask: true, on: { click: handelDownload } }" />
12
+ <ElPlusFormBtn type="primary" v-if="getVIf(exportConf) && exportConf" :desc="{ label: '导出Excel', size, disabled: exportConf?.disabled, mask: true, on: { click: handelDownload } }" />
13
13
  <template v-for="(item, i) in headerBtns" :key="i">
14
14
  <template v-if="getVIf(item)">
15
15
  <template v-if="item.customize">
@@ -229,12 +229,20 @@ function handelReset() {
229
229
  * @param item
230
230
  */
231
231
  function getVIf(item: any) {
232
- if (item.vif) {
232
+ if (item?.vif) {
233
233
  if (typeof item.vif === 'function') {
234
234
  return item.vif(item)
235
235
  }
236
236
  return !!item.vif
237
237
  }
238
+ // 这里最终处理一下auth权限问题
239
+ if (item?.auth) {
240
+ if (!defaultConf.auth) {
241
+ console.warn('使用auth属性,请在crud注册时传入auth校验方法~')
242
+ } else {
243
+ return defaultConf.auth(item.auth)
244
+ }
245
+ }
238
246
  return true
239
247
  }
240
248
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "el-plus-crud",
3
3
  "description": "采用Vue3 + TS,封装的element-plus数据驱动表单、列表组件",
4
4
  "author": "K.D.Jack",
5
- "version": "0.1.2",
5
+ "version": "0.1.4",
6
6
  "license": "MIT",
7
7
  "private": false,
8
8
  "main": "dist/el-plus-crud.mjs",