chore: app 模式自动加 affixOffsetTop Closes #3963 (#3970)

* docs: 补充 app 模式 CRUD 表头固定遮挡问题说明 Closes #3963

* 改成 app 模式自动加 affixOffsetTop
This commit is contained in:
吴多益 2022-04-06 13:49:51 +08:00 committed by GitHub
parent f507e88496
commit 536af47d6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -24,11 +24,16 @@ import attachmentAdpator from '../src/utils/attachmentAdpator';
export function embed(
container: string | HTMLElement,
schema: any,
props?: any,
props: any = {},
env?: any
) {
const __ = makeTranslator(env?.locale || props?.locale);
// app 模式自动加 affixOffsetTop
if (!('affixOffsetTop' in props) && schema.type === 'app') {
props.affixOffsetTop = 50;
}
if (typeof container === 'string') {
container = document.querySelector(container) as HTMLElement;
}

View File

@ -2,9 +2,9 @@ const predefined = {
crud: {
type: 'crud',
draggable: true,
api:
'http://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/sample',
api: 'http://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/sample',
syncLocation: false,
perPage: 50,
filter: {
title: '条件搜索',
submitText: '',
@ -163,8 +163,7 @@ const predefined = {
},
{
type: 'html',
html:
'<p>添加其他 <span>Html 片段</span> 需要支持变量替换todo.</p>'
html: '<p>添加其他 <span>Html 片段</span> 需要支持变量替换todo.</p>'
}
]
}