mirror of
https://github.com/cheney2013/UIState.git
synced 2025-04-18 21:09:04 +00:00
32 lines
932 B
JavaScript
32 lines
932 B
JavaScript
|
"use strict";
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
const fs_1 = require("fs");
|
||
|
const path_1 = require("path");
|
||
|
module.exports = Editor.Panel.define({
|
||
|
listeners: {
|
||
|
show() {
|
||
|
console.log("show", arguments);
|
||
|
},
|
||
|
hide() {
|
||
|
console.log("hide");
|
||
|
}
|
||
|
},
|
||
|
template: (0, fs_1.readFileSync)((0, path_1.join)(__dirname, "../../../static/template/default/index.html"), "utf-8"),
|
||
|
style: "div { color: yellow; }",
|
||
|
$: {
|
||
|
btnCopy: "#btnCopy",
|
||
|
code: "#code"
|
||
|
},
|
||
|
methods: {},
|
||
|
ready() {
|
||
|
if (arguments[0])
|
||
|
this.$.code.innerHTML = JSON.stringify(arguments[0], null, 2);
|
||
|
this.$.btnCopy.addEventListener('confirm', () => {
|
||
|
Editor.Clipboard.write("text", this.$.code.innerHTML);
|
||
|
console.log("已复制到剪贴板!");
|
||
|
});
|
||
|
},
|
||
|
beforeClose() { },
|
||
|
close() { }
|
||
|
});
|