Skip to content
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

建议: 要是能用配置对象来实例化picgo就更好了 #3

Closed
J3n5en opened this issue Jan 15, 2019 · 2 comments
Closed

建议: 要是能用配置对象来实例化picgo就更好了 #3

J3n5en opened this issue Jan 15, 2019 · 2 comments

Comments

@J3n5en
Copy link

J3n5en commented Jan 15, 2019

建议: 要是能用配置对象能实例化picgo就更好了
类似:

const conf = {
  "picBed": {
    "uploader": "smms"
  }
}
const picgo = new PicGo(conf)

感觉这样拓展起来比较方便。

@J3n5en J3n5en changed the title 建议: 要是能用配置对象能实例化picgo就更好了 建议: 要是能用配置对象来实例化picgo就更好了 Jan 15, 2019
@Molunerfinn
Copy link
Member

一开始做的时候是用配置对象实例化的。

但是后来引入了插件以及需要持久化存储配置项等所以改成了需要至少一个配置文件,并围绕这个配置文件所在路径扩展插件等一系列操作。目前整体结构都是在这个基础之上做的,所以应该是不会改变。

@Molunerfinn
Copy link
Member

Molunerfinn commented Apr 14, 2019

最近有个新思路来「曲线」实现你说的这个功能:

https://github.com/PicGo/vs-picgo/blob/dev/src/extension.ts#L208

利用PicGo提供的setConfig方法,在实例化后可以更改配置达到用配置对象来配置PicGo的目的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants