Skip to content

Commit

Permalink
Merge pull request vbenjs#1 from vbenjs/main
Browse files Browse the repository at this point in the history
merge remote branch
  • Loading branch information
xdcheng authored Nov 21, 2022
2 parents 057b826 + 4e16438 commit dea0e40
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 13 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,14 @@ jobs:
git push origin --delete gh-pages
- name: Deploy
uses: peaceiris/actions-gh-pages@v2.5.0
env:
ACTIONS_DEPLOY_KEY: ${{secrets.ACTIONS_DEPLOY_KEY}}
uses: peaceiris/actions-gh-pages@v3.9.0
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./dist
with:
forceOrphan: true
CNAME: vben.vvbin.cn





10 changes: 9 additions & 1 deletion src/components/Preview/src/Functional.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,16 @@
}
// 缩放函数
function scaleFunc(num: number) {
// 最小缩放
const MIN_SCALE = 0.02;
// 放大缩小的颗粒度
const GRA = 0.1;
if (imgState.imgScale <= 0.2 && num < 0) return;
imgState.imgScale += num;
imgState.imgScale += num * GRA;
// scale 不能 < 0,否则图片会倒置放大
if (imgState.imgScale < 0) {
imgState.imgScale = MIN_SCALE;
}
}
// 旋转图片
Expand Down
2 changes: 1 addition & 1 deletion src/components/Table/src/hooks/useCustomRow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function useCustomRow(
function handleClick() {
const { rowSelection, rowKey, clickToRowSelect } = unref(propsRef);
if (!rowSelection || !clickToRowSelect) return;
const keys = getSelectRowKeys();
const keys = getSelectRowKeys() || [];
const key = getKey(record, rowKey, unref(getAutoCreateKey));
if (!key) return;

Expand Down
4 changes: 2 additions & 2 deletions src/components/Table/src/hooks/useRowSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ export function useRowSelection(
selectedRowKeysRef.value = rowKeys;
const allSelectedRows = findNodeAll(
toRaw(unref(tableData)).concat(toRaw(unref(selectedRowRef))),
(item) => rowKeys.includes(item[unref(getRowKey) as string]),
(item) => rowKeys?.includes(item[unref(getRowKey) as string]),
{
children: propsRef.value.childrenColumnName ?? 'children',
},
);
const trueSelectedRows: any[] = [];
rowKeys.forEach((key: string) => {
rowKeys?.forEach((key: string) => {
const found = allSelectedRows.find((item) => item[unref(getRowKey) as string] === key);
found && trueSelectedRows.push(found);
});
Expand Down
10 changes: 6 additions & 4 deletions src/views/demo/table/FormTable.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<BasicTable
@register="registerTable"
:rowSelection="{ type: 'checkbox', selectedRowKeys: checkedKeys, onChange: onSelectChange }"
>
<BasicTable @register="registerTable">
<template #form-custom> custom-slot </template>
<template #headerTop>
<a-alert type="info" show-icon>
Expand Down Expand Up @@ -44,6 +41,11 @@
tableSetting: { fullScreen: true },
showIndexColumn: false,
rowKey: 'id',
rowSelection: {
type: 'checkbox',
selectedRowKeys: checkedKeys,
onChange: onSelectChange,
},
});
function getFormValues() {
Expand Down

0 comments on commit dea0e40

Please sign in to comment.