[mod] 非Vue

This commit is contained in:
2022-04-14 12:22:08 +08:00
parent e7255001be
commit c5f2494657
8 changed files with 53 additions and 12102 deletions

View File

@@ -1,44 +1,39 @@
const PACKAGE_NAME = "uuidconvert";
const fs = require("fs");
const vue = Editor.require(`packages://${PACKAGE_NAME}/lib/vue.js`);
Editor.Panel.extend({
style: fs.readFileSync(Editor.url(`packages://${PACKAGE_NAME}/static/style/default/index.css`), 'utf-8')
.concat(fs.readFileSync(Editor.url(`packages://${PACKAGE_NAME}/static/style/default/bootstrap.min.css`), 'utf-8')),
template: fs.readFileSync(
Editor.url(`packages://${PACKAGE_NAME}/static/template/default/index.html`), 'utf-8'),
Editor.url(`packages://${PACKAGE_NAME}/index.html`), 'utf-8'),
$: {
app: '#app',
run: '#run',
uuid: '#uuid',
asset: '#asset',
},
ready() {
this.app = new vue({
el: this.$app,
created: function () {
},
components: {
"counter": Editor.require(`packages://${PACKAGE_NAME}/static/template/vue/counter.js`)
},
data: function () {
return {}
},
methods: {
},
watch: {
}
})
this.$run.addEventListener("confirm", this.methods.run.bind(this));
},
methods: {
run() {
let uuid = "";
// Editor.log(`$asset: ${this.$asset.value}`);
if (!this.$uuid.value) {
if (!this.$asset.value) {
Editor.error("請輸入要轉換的UUID");
return;
} else {
uuid = this.$asset.value;
}
} else {
uuid = this.$uuid.value;
}
Editor.Ipc.sendToMain("uuidconvert:run-click", uuid);
},
},
messages: {