fix device

This commit is contained in:
kangwei 2020-05-15 14:33:14 +08:00
commit 2d7b37e4c5
5 changed files with 8 additions and 4 deletions

View File

@ -31,12 +31,13 @@
&-device-iphone6 {
left: 50%;
width: 368px;
width: 378px;
transform: translateX(-50%);
background: url(https://img.alicdn.com/tps/TB12GetLpXXXXXhXFXXXXXXXXXX-756-1544.png) no-repeat top;
background-size: 378px 772px;
top: 8px;
.@{scope}-canvas-viewport {
width: auto;
top: 114px;
left: 25px;
right: 25px;

View File

@ -78,7 +78,7 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
readonly designer = this.document.designer;
@computed get device(): string | undefined {
return this.get('device') || 'default';
return this.get('device') || 'mobile';
}
@computed get deviceClassName(): string | undefined {

View File

@ -108,7 +108,7 @@ export class LiveEditing {
onSaveContent(setterPropElement!.innerText, prop);
};
const keydown = (e: KeyboardEvent) {
const keydown = (e: KeyboardEvent) => {
console.info(e.code);
// esc
// enter

View File

@ -162,7 +162,7 @@ export default class Engine extends PureComponent {
debug('entry.render');
const { componentName } = schema;
const allComponents = { ...ENGINE_COMPS, ...components };
let Comp = allComponents[componentName];
let Comp = allComponents[componentName] || ENGINE_COMPS[`${componentName}Engine`];
if (Comp && Comp.prototype) {
const proto = Comp.prototype;
if (!(Comp.prototype instanceof BaseEngine)) {

View File

@ -57,6 +57,9 @@ const pages = Object.assign(project, {
},
onCurrentPageChange(fn: (page: DocumentModel) => void) {
return project.onCurrentDocumentChange(fn);
},
toData() {
return project.documents.map(doc => doc.toData());
}
});