这是文档地址https://docs.cocos.com/creator/3.1/manual/zh/editor/extension/panel-boot.html
我打印出来的是字符串并不是dom
这是文档地址https://docs.cocos.com/creator/3.1/manual/zh/editor/extension/panel-boot.html
我打印出来的是字符串并不是dom
const packageJSON = require(’./package.json’);
const scene = require(’./scene’);
exports.template = ‘hello’;
// 样式文本
exports.style = ‘.test{ color:red }’;
exports.$ = {
test:'.test'
};
exports.ready = async () => {
// const tab = await Editor.Message.request(packageJSON.name, 'query', 'tab') || null;
// const subTab = await Editor.Message.request(packageJSON.name, 'query', 'subTab') || null;
console.log(this.$.test,'this.$.div') //".test"
};
箭头函数改成匿名函数就好了
没想到这个坑被你猜中啦
该主题在最后一个回复创建后14天后自动关闭。不再允许新的回复。