update at 2025-10-09 12:39:24
This commit is contained in:
@@ -53,7 +53,7 @@ export class PlatformChooser {
|
||||
|
||||
constructor(container: HTMLElement, options: PlatformChooserOptions = {}) {
|
||||
this.container = container;
|
||||
this.currentPlatform = options.defaultPlatform || 'wechat';
|
||||
this.currentPlatform = options.defaultPlatform || 'xiaohongshu';
|
||||
if (options.onPlatformChange) {
|
||||
this.onChange = (platform) => {
|
||||
options.onPlatformChange!(platform);
|
||||
@@ -72,15 +72,16 @@ export class PlatformChooser {
|
||||
* 渲染平台选择器 UI
|
||||
*/
|
||||
render(): void {
|
||||
// 创建平台选择行
|
||||
const lineDiv = this.container.createDiv({ cls: 'toolbar-line platform-selector-line' });
|
||||
// 将容器作为单层 Grid 行使用
|
||||
this.container.addClass('platform-selector-line');
|
||||
this.container.addClass('platform-chooser-grid');
|
||||
|
||||
// 创建标签
|
||||
const platformLabel = lineDiv.createDiv({ cls: 'style-label' });
|
||||
const platformLabel = this.container.createDiv({ cls: 'style-label' });
|
||||
platformLabel.innerText = '发布平台';
|
||||
|
||||
// 创建选择器
|
||||
const platformSelect = lineDiv.createEl('select', { cls: 'platform-select' });
|
||||
const platformSelect = this.container.createEl('select', { cls: 'platform-select' });
|
||||
this.selectElement = platformSelect;
|
||||
|
||||
// 添加平台选项
|
||||
|
||||
Reference in New Issue
Block a user