📝 便笺插件

两份文件就能在侧边栏加一个页面

把下面两份文件放进 mods/hello-note,刷新创意工坊并打开开关。侧边栏会出现「便笺」,点进去就是插件自己的页面。

manifest.json

{
  "id": "hello-note",
  "name": "便笺",
  "version": "1.0.0",
  "description": "在侧边栏加一个自己的页面",
  "author": "你的名字",
  "entry": "index.js",
  "icon": "📝"
}

index.js

export default {
  async onLoad(api) {
    api.navigation.register({
      id: 'hello-note',
      name: '便笺',
      icon: '📝',
      onClick: () => {
        api.ui.showCustomView({
          title: '便笺',
          content: '<p>这是插件自己的页面。</p>'
        })
      }
    })
  },
  async onUnload(api) {
    api.navigation.unregister('hello-note')
  }
}