mirror of
https://github.com/cheney2013/UIState.git
synced 2025-10-10 09:05:25 +00:00
UIState
This commit is contained in:
31
extensions/uistate-inspector/dist/panels/default/index.js
vendored
Normal file
31
extensions/uistate-inspector/dist/panels/default/index.js
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
"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() { }
|
||||
});
|
Reference in New Issue
Block a user