import { version } from '../config';
let node = document.createElement('div');
node.textContent = `V${version}`;
node.style.pointerEvents = 'none';
node.style.fontSize = '12px';
node.style.color = 'white';
node.style.position = 'fixed';
node.style.bottom = '0';
node.style.left = '0';
node.style.transform = 'scale(.8)';
node.style.transformOrigin = 'left bottom';
node.style.textShadow = '0 0 1px gray';
document.body.appendChild(node);
function show() {
node.style.opacity = '1';
}
function hide() {
node.style.opacity = '0';
}
export default {
show,
hide,
};
以上的代码是为了在游戏左下角展示版本号,但是为什么这段代码在编辑器里面执行了,并在编辑器左下角添加了版本号(下图中的v1.2.0)?
