优化 setting-utils
This commit is contained in:
parent
b1a061cb0c
commit
1a0b1018c5
2 changed files with 29 additions and 5 deletions
14
src/index.ts
14
src/index.ts
|
@ -176,6 +176,13 @@ export default class PluginSample extends Plugin {
|
|||
title: "Readonly text",
|
||||
description: "Input description",
|
||||
});
|
||||
this.settingUtils.addItem({
|
||||
key: "Check",
|
||||
value: true,
|
||||
type: "checkbox",
|
||||
title: "Checkbox text",
|
||||
description: "Check description",
|
||||
});
|
||||
this.settingUtils.addItem({
|
||||
key: "Select",
|
||||
value: 1,
|
||||
|
@ -220,7 +227,6 @@ export default class PluginSample extends Plugin {
|
|||
}
|
||||
}
|
||||
});
|
||||
this.settingUtils.load();
|
||||
|
||||
this.protyleSlash = [{
|
||||
filter: ["insert emoji 😊", "插入表情 😊", "crbqwx"],
|
||||
|
@ -235,12 +241,14 @@ export default class PluginSample extends Plugin {
|
|||
}
|
||||
|
||||
onLayoutReady() {
|
||||
this.loadData(STORAGE_NAME);
|
||||
// this.loadData(STORAGE_NAME);
|
||||
this.settingUtils.load();
|
||||
console.log(`frontend: ${getFrontend()}; backend: ${getBackend()}`);
|
||||
}
|
||||
|
||||
onunload() {
|
||||
async onunload() {
|
||||
console.log(this.i18n.byePlugin);
|
||||
await this.settingUtils.save();
|
||||
showMessage("Goodbye SiYuan Plugin");
|
||||
console.log("onunload");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue