init
This commit is contained in:
parent
760a54efd1
commit
ef59d612c3
23 changed files with 2139 additions and 0 deletions
38
src/index.ts
Normal file
38
src/index.ts
Normal file
|
@ -0,0 +1,38 @@
|
|||
/**
|
||||
* Copyright (c) 2023 frostime. All rights reserved.
|
||||
* https://github.com/frostime/sy-plugin-template-vite
|
||||
*/
|
||||
import { Plugin, showMessage, Dialog } from "siyuan"
|
||||
import Hello from "./hello.svelte"
|
||||
import "./index.scss"
|
||||
|
||||
export default class SamplePlugin extends Plugin {
|
||||
|
||||
async onload() {
|
||||
console.log("onload");
|
||||
showMessage("Hello World");
|
||||
this.addTopBar(
|
||||
{
|
||||
icon: "iconEmoji",
|
||||
"title": "Hello SiYuan",
|
||||
"callback": () => {
|
||||
let dialog = new Dialog({
|
||||
title: "Hello World",
|
||||
content: `<div id="helloPanel"></div>`,
|
||||
});
|
||||
new Hello({
|
||||
target: dialog.element.querySelector("#helloPanel"),
|
||||
props: {
|
||||
name: this.i18n.name,
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
async onunload() {
|
||||
showMessage("Goodbye World");
|
||||
console.log("onunload");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue