Browse Source
chore: perf TableAction.vue、build/utils.ts、prettier.config.js (#868)
* perf: 优化 build 时 vite 模式判断
* perf: 优化 TableAction, 仅在 action.tooltip 存在的情况下 才使用 Tooltip 组件
* docs: 仅在 action.tooltip 存在的情况下 才使用 Tooltip 组件
* fix: 在 window 上,拉取代码后 eslint 因 endOfLine 而保错问题
* docs: 修复在 window 上,拉取代码后 eslint 因 endOfLine 而保错问题
pull/896/head
周旭
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
16 additions and
12 deletions
-
CHANGELOG.zh_CN.md
-
build/utils.ts
-
prettier.config.js
-
src/components/Table/src/components/TableAction.vue
|
|
|
@ -5,9 +5,11 @@ |
|
|
|
- 修复树形表格的带有展开图标的单元格的内容对齐问题 |
|
|
|
- 新增`headerTop`插槽 |
|
|
|
- **AppSearch** 修复可能会搜索隐藏菜单的问题 |
|
|
|
- **TableAction** 仅在 action.tooltip 存在的情况下 才包裹 Tooltip 组件 |
|
|
|
- **其它** |
|
|
|
- 修复菜单默认折叠的配置不起作用的问题 |
|
|
|
- 修复`safari`浏览器报错导致网站打不开 |
|
|
|
- 修复在 window 上,拉取代码后 eslint 因 endOfLine 而保错问题 |
|
|
|
|
|
|
|
### 🎫 Chores |
|
|
|
|
|
|
|
|
|
|
|
@ -44,7 +44,7 @@ export function wrapperEnv(envConf: Recordable): ViteEnv { |
|
|
|
*/ |
|
|
|
function getConfFiles() { |
|
|
|
const script = process.env.npm_lifecycle_script; |
|
|
|
const reg = new RegExp('--mode ([a-z]+) '); |
|
|
|
const reg = new RegExp('--mode ([a-z]+)'); |
|
|
|
const result = reg.exec(script as string) as any; |
|
|
|
if (result) { |
|
|
|
const mode = result[1] as string; |
|
|
|
|
|
|
|
@ -15,6 +15,6 @@ module.exports = { |
|
|
|
requirePragma: false, |
|
|
|
proseWrap: 'never', |
|
|
|
htmlWhitespaceSensitivity: 'strict', |
|
|
|
endOfLine: 'lf', |
|
|
|
endOfLine: 'auto', |
|
|
|
rangeStart: 0, |
|
|
|
}; |
|
|
|
|
|
|
|
@ -1,12 +1,16 @@ |
|
|
|
<template> |
|
|
|
<div :class="[prefixCls, getAlign]" @click="onCellClick"> |
|
|
|
<template v-for="(action, index) in getActions" :key="`${index}-${action.label}`"> |
|
|
|
<Tooltip v-bind="getTooltip(action.tooltip)"> |
|
|
|
<Tooltip v-if="action.tooltip" v-bind="getTooltip(action.tooltip)"> |
|
|
|
<PopConfirmButton v-bind="action"> |
|
|
|
<Icon :icon="action.icon" class="mr-1" v-if="action.icon" /> |
|
|
|
{{ action.label }} |
|
|
|
</PopConfirmButton> |
|
|
|
</Tooltip> |
|
|
|
<PopConfirmButton v-else v-bind="action"> |
|
|
|
<Icon :icon="action.icon" class="mr-1" v-if="action.icon" /> |
|
|
|
{{ action.label }} |
|
|
|
</PopConfirmButton> |
|
|
|
<Divider |
|
|
|
type="vertical" |
|
|
|
class="action-divider" |
|
|
|
@ -126,15 +130,13 @@ |
|
|
|
return actionColumn?.align ?? 'left'; |
|
|
|
}); |
|
|
|
|
|
|
|
const getTooltip = computed(() => { |
|
|
|
return (data: string | TooltipProps): TooltipProps => { |
|
|
|
if (isString(data)) { |
|
|
|
return { title: data, placement: 'bottom' }; |
|
|
|
} else { |
|
|
|
return Object.assign({ placement: 'bottom' }, data); |
|
|
|
} |
|
|
|
}; |
|
|
|
}); |
|
|
|
function getTooltip(data: string | TooltipProps): TooltipProps { |
|
|
|
if (isString(data)) { |
|
|
|
return { title: data, placement: 'bottom' }; |
|
|
|
} else { |
|
|
|
return Object.assign({ placement: 'bottom' }, data); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function onCellClick(e: MouseEvent) { |
|
|
|
if (!props.stopButtonPropagation) return; |
|
|
|
|