Merge pull request #11194 from qkiroc/chore/animation-setting
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
gh-pages / build (20.x) (push) Waiting to run

chore: 优化animations配置警告问题
This commit is contained in:
Allen 2024-11-14 10:09:13 +08:00 committed by GitHub
commit fb17a5e039
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1364,12 +1364,36 @@ setSchemaTpl('animation', () => {
}
return undefined;
},
onChange: (value: any, a: any, b: any, {data}: any) => {
if (value) {
const {id} = data;
let animationType = 'fadeIn';
if ('children' in animationOptions[type][0]) {
// @ts-ignore
animationType = animationOptions[type][0].children[0].value;
} else {
// @ts-ignore
animationType = animationOptions[type][0].value;
}
playAnimation(
{
[type]: {
delay: 0,
duration: 1,
type: animationType
}
},
id,
type
);
}
},
label
},
{
type: 'container',
className: 'm-b ae-ExtendMore',
visibleOn: `animations.${type}`,
visibleOn: `\${animations && animations.${type}}`,
body: [
{
type: 'select',
@ -1449,7 +1473,7 @@ setSchemaTpl('animation', () => {
},
{
type: 'button',
visibleOn: `animations.${type}`,
visibleOn: `\${animations && animations.${type}}`,
className: 'm-b',
block: true,
level: 'enhance',