8000 feat: fix bug of vtable records by xuefei1313 · Pull Request #270 · VisActor/VStory · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: fix bug of vtable records #270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by 8000 extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions packages/vstory-core/src/character/table/character-table.ts
8000
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { getLayoutFromWidget } from '../../utils/layout';
import type { ITableCharacterRuntime } from './interface/runtime';
import { TableConfigProcess } from './table-config-process';
import type { ICharacterTable, IVTable } from './interface/character-table';
import { isArray } from '@visactor/vutils';
import { isArray, isObject } from '@visactor/vutils';

export class CharacterTable<T extends ITableGraphicAttribute>
extends CharacterBase<ITableGraphicAttribute>
Expand Down Expand Up @@ -170,9 +170,20 @@ export class CharacterTable<T extends ITableGraphicAttribute>
}

getDefaultAttribute(): Partial<ITableGraphicAttribute> {
let records = this._config.options.spec?.records;
if (isArray(records)) {
records = records.slice();
} else if (isObject(records)) {
records = { ...records };
Object.keys(records).forEach(key => {
records[key] = records[key].slice();
});
} else {
records = [];
}
return {
spec: Object.assign({}, this._config.options.spec, {
records: (this._config.options.spec?.records ?? []).slice()
records
}),
dpr: this._canvas.getDpr(),
autoRender: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/vstory-core/src/core/story.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class Story extends EventEmitter implements IStory {
this._theme = theme;
this.pluginService = new DefaultPluginService();
this.pluginService.active(this, {
pluginList: []
pluginList
});
}

Expand Down
Loading
0