remove dock.svelte
This commit is contained in:
parent
ead99605fd
commit
44e0010f6a
3 changed files with 16 additions and 34 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "plugin-sample-vite-svelte",
|
"name": "plugin-sample-vite-svelte",
|
||||||
"version": "0.0.4",
|
"version": "0.0.6",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "",
|
"description": "",
|
||||||
"repository": "",
|
"repository": "",
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
<script lang="ts">
|
|
||||||
import { adaptHotkey } from "siyuan";
|
|
||||||
export let text: string;
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="fn__flex-1 fn__flex-column">
|
|
||||||
<div class="block__icons">
|
|
||||||
<div class="block__logo">
|
|
||||||
<svg><use xlink:href="#iconEmoji" /></svg>
|
|
||||||
Custom Dock
|
|
||||||
</div>
|
|
||||||
<span class="fn__flex-1 fn__space" />
|
|
||||||
<span
|
|
||||||
data-type="min"
|
|
||||||
class="block__icon b3-tooltips b3-tooltips__sw"
|
|
||||||
aria-label="Min ${adaptHotkey('⌘W')}"
|
|
||||||
><svg><use xlink:href="#iconMin" /></svg></span
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
<div class="fn__flex-1 plugin-sample__custom-dock">
|
|
||||||
{text}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
23
src/index.ts
23
src/index.ts
|
@ -1,8 +1,7 @@
|
||||||
import { Plugin, showMessage, confirm, Dialog, Menu, isMobile, openTab } from "siyuan";
|
import { Plugin, showMessage, confirm, Dialog, Menu, isMobile, openTab, adaptHotkey } from "siyuan";
|
||||||
import "./index.scss";
|
import "./index.scss";
|
||||||
|
|
||||||
import HelloExample from "./hello.svelte";
|
import HelloExample from "./hello.svelte";
|
||||||
import DockExample from "./dock.svelte";
|
|
||||||
import SettingPannel from "./libs/setting-panel.svelte";
|
import SettingPannel from "./libs/setting-panel.svelte";
|
||||||
|
|
||||||
const STORAGE_NAME = "menu-config";
|
const STORAGE_NAME = "menu-config";
|
||||||
|
@ -57,16 +56,22 @@ export default class SamplePlugin extends Plugin {
|
||||||
},
|
},
|
||||||
type: DOCK_TYPE,
|
type: DOCK_TYPE,
|
||||||
init() {
|
init() {
|
||||||
this.component = new DockExample({
|
this.element.innerHTML = `<div class="fn__flex-1 fn__flex-column">
|
||||||
target: this.element,
|
<div class="block__icons">
|
||||||
props: {
|
<div class="block__logo">
|
||||||
text: this.data.text,
|
<svg><use xlink:href="#iconEmoji"></use></svg>
|
||||||
}
|
Custom Dock
|
||||||
});
|
</div>
|
||||||
|
<span class="fn__flex-1 fn__space"></span>
|
||||||
|
<span data-type="min" class="block__icon b3-tooltips b3-tooltips__sw" aria-label="Min ${adaptHotkey("⌘W")}"><svg><use xlink:href="#iconMin"></use></svg></span>
|
||||||
|
</div>
|
||||||
|
<div class="fn__flex-1 plugin-sample__custom-dock">
|
||||||
|
${this.data.text}
|
||||||
|
</div>
|
||||||
|
</div>`;
|
||||||
},
|
},
|
||||||
destroy() {
|
destroy() {
|
||||||
console.log("destroy dock:", DOCK_TYPE);
|
console.log("destroy dock:", DOCK_TYPE);
|
||||||
this.component.$destroy();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue