feat: support opening document with id

This commit is contained in:
LeoYuan 袁力皓 2022-06-28 10:58:39 +08:00 committed by 林熠
parent 152a24d655
commit 3f7c0cd519

View File

@ -214,7 +214,7 @@ export class Project {
return doc.open();
}
if (typeof doc === 'string') {
const got = this.documents.find((item) => item.fileName === doc);
const got = this.documents.find((item) => item.fileName === doc || item.id === doc);
if (got) {
return got.open();
}