mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-15 09:21:13 +08:00
page的css属性支持解析动画和audio组件展示NAN的buf_fix
This commit is contained in:
parent
066f75bfa6
commit
d7c78aeeb8
@ -299,8 +299,8 @@ export class Audio extends React.Component<AudioProps, AudioState> {
|
||||
formatTime(seconds: number) {
|
||||
const date = new Date(seconds * 1000);
|
||||
const hh = date.getUTCHours();
|
||||
const mm = date.getUTCMinutes();
|
||||
const ss = this.pad(date.getUTCSeconds());
|
||||
const mm = isNaN(date.getUTCMinutes()) ? 0 : date.getUTCMinutes();
|
||||
const ss = isNaN(date.getUTCSeconds()) ? '00': this.pad(date.getUTCSeconds());
|
||||
if (hh) {
|
||||
return `${hh}:${this.pad(mm)}:${ss}`;
|
||||
}
|
||||
|
@ -41,18 +41,11 @@ import {buildStyle} from 'amis-core';
|
||||
import {PullRefresh} from 'amis-ui';
|
||||
import {scrollPosition, isMobile} from 'amis-core';
|
||||
|
||||
/**
|
||||
* 样式属性名及值
|
||||
*/
|
||||
interface Declaration {
|
||||
[property: string]: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* css 定义
|
||||
*/
|
||||
interface CSSRule {
|
||||
[selector: string]: Declaration; // 定义
|
||||
[selector: string]: Record<string, string> | Record<string, Record<string, string>>; // 定义
|
||||
}
|
||||
|
||||
/**
|
||||
@ -333,7 +326,16 @@ export default class Page extends React.Component<PageProps> {
|
||||
const declaration = cssRules[selector];
|
||||
let declarationStr = '';
|
||||
for (const property in declaration) {
|
||||
declarationStr += ` ${property}: ${declaration[property]};\n`;
|
||||
let innerstr = ''
|
||||
const innerValue=declaration[property]
|
||||
if (typeof innerValue==='string') {
|
||||
declarationStr += ` ${property}: ${innerValue};\n`;
|
||||
} else {
|
||||
for (const propsName in innerValue) {
|
||||
innerstr+= ` ${propsName}:${innerValue[propsName]};`;
|
||||
}
|
||||
declarationStr += ` ${property} {${innerstr}}\n`;
|
||||
}
|
||||
}
|
||||
|
||||
css += `
|
||||
|
Loading…
Reference in New Issue
Block a user