Merge branch 'master' of https://github.com/baidu/amis
This commit is contained in:
commit
8a6e178881
|
@ -46,7 +46,7 @@ exports[`Renderer:date 1`] = `
|
||||||
<span
|
<span
|
||||||
class="a-DatePicker-value"
|
class="a-DatePicker-value"
|
||||||
>
|
>
|
||||||
2019-06-06 21:11
|
2019-06-06 21:11:00
|
||||||
</span>
|
</span>
|
||||||
<a
|
<a
|
||||||
class="a-DatePicker-clear"
|
class="a-DatePicker-clear"
|
||||||
|
|
|
@ -30,7 +30,7 @@ test('Renderer:date', async () => {
|
||||||
})));
|
})));
|
||||||
|
|
||||||
const input = container.querySelector('.a-DatePicker-value');
|
const input = container.querySelector('.a-DatePicker-value');
|
||||||
expect(input.innerHTML).toEqual('2019-06-06 21:11');
|
expect(input.innerHTML).toEqual('2019-06-06 21:11:00');
|
||||||
|
|
||||||
expect(container).toMatchSnapshot();
|
expect(container).toMatchSnapshot();
|
||||||
});
|
});
|
|
@ -4,10 +4,10 @@ exports[`Renderer:carousel 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
class="a-Carousel a-Carousel--light show"
|
class="a-Carousel a-Carousel--light show"
|
||||||
|
style="width: 500px; height: 300px;"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="a-Carousel-container"
|
class="a-Carousel-container"
|
||||||
style="width: 500px; height: 300px;"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="a-Carousel-item fade in"
|
class="a-Carousel-item fade in"
|
||||||
|
|
|
@ -420,6 +420,14 @@ class SchemaRenderer extends React.Component<SchemaRendererProps, any> {
|
||||||
delete schema.$ref;
|
delete schema.$ref;
|
||||||
path = path.replace(/(?!.*\/).*/, schema.type);
|
path = path.replace(/(?!.*\/).*/, schema.type);
|
||||||
}
|
}
|
||||||
|
// value 会提前从 control 中获取到,所有需要把control中的属性也补充完整
|
||||||
|
if (schema.control && schema.control.$ref) {
|
||||||
|
schema.control = {
|
||||||
|
...props.resolveDefinitions(schema.control.$ref),
|
||||||
|
...schema.control
|
||||||
|
}
|
||||||
|
delete schema.control.$ref;
|
||||||
|
}
|
||||||
this.renderer = rendererResolver(path, schema, props);
|
this.renderer = rendererResolver(path, schema, props);
|
||||||
return schema;
|
return schema;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue