Skip to content

Update plugin addDock callback parameter scope #14752

Closed
@Wetoria

Description

@Wetoria

Is there an existing issue for this?

  • I have searched the existing issues

Can the issue be reproduced with the default theme (daylight/midnight)?

  • I was able to reproduce the issue with the default theme

Could the issue be due to extensions?

  • I've ruled out the possibility that the extension is causing the problem.

Describe the problem

addDock 中提供的类型为 Dock,实际上传递的是 Custom。

Expected result

Screenshot or screen recording presentation

No response

Version environment

- Version: 
- Operating System: 
- Browser (if used):

Log file

More information

No response

Activity

Vanessa219

Vanessa219 commented on May 5, 2025

@Vanessa219
Member

Custom 的参数是这个,addDock 的参数和实现是一致的。建议如何修改呢?
Image

Wetoria

Wetoria commented on May 5, 2025

@Wetoria
Author
Vanessa219

Vanessa219 commented on May 6, 2025

@Vanessa219
Member

没法一致,两个参数是不一样的。返回的 model 就是 Custom。

移动端的布局结构导致 Dock 和 PC 不一致,因此没有对应的方法。

为确保唯一性,不同的 dock 需要不同的 type。

Vanessa219

Vanessa219 commented on May 13, 2025

@Vanessa219
Member

没有问题的话我先关闭了。

Wetoria

Wetoria commented on May 13, 2025

@Wetoria
Author

addDock 的几个回调函数,实际上只有init的参数是 Custom,其他都是没有参数,但是现在写的是 Dock

这是 addDock 中的:

Image

实际上的:

桌面端 Custom:
Image

移动端 MobileCustom:

Image
changed the title [-]插件 Plugin.addDock 类型错误[/-] [+]update Plugin.addDock [/+] on May 17, 2025
added this to the 3.1.30 milestone on May 17, 2025
changed the title [-]update Plugin.addDock [/-] [+]Update plugin `addDock` callback parameter scope[/+] on May 17, 2025
added a commit that references this issue on May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @Vanessa219@Wetoria

      Issue actions

        Update plugin `addDock` callback parameter scope · Issue #14752 · siyuan-note/siyuan