mirror of
https://gitee.com/abc126655/finder-refferenct3
synced 2024-12-25 19:28:23 +00:00
1 line
1.1 KiB
JavaScript
1 line
1.1 KiB
JavaScript
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const fs_extra_1=require("fs-extra"),path_1=require("path"),vue_1=require("vue"),panelDataMap=new WeakMap;module.exports=Editor.Panel.define({listeners:{show(){console.log("show")},hide(){console.log("hide")}},template:(0,fs_extra_1.readFileSync)((0,path_1.join)(__dirname,"../../../static/template/default/index.html"),"utf-8"),style:(0,fs_extra_1.readFileSync)((0,path_1.join)(__dirname,"../../../static/style/default/index.css"),"utf-8"),$:{app:"#app",text:"#text"},methods:{hello(){this.$.text&&(this.$.text.innerHTML="hello",console.log("[cocos-panel-html.default]: hello"))}},ready(){var e;this.$.text&&(this.$.text.innerHTML="Hello Cocos."),this.$.app&&((e=(0,vue_1.createApp)({})).config.compilerOptions.isCustomElement=e=>e.startsWith("ui-"),e.component("MyCounter",{template:(0,fs_extra_1.readFileSync)((0,path_1.join)(__dirname,"../../../static/template/vue/counter.html"),"utf-8"),data(){return{counter:0}},methods:{addition(){this.counter+=1},subtraction(){--this.counter}}}),e.mount(this.$.app),panelDataMap.set(this,e))},beforeClose(){},close(){var e=panelDataMap.get(this);e&&e.unmount()}});
|