[]微信小游戏,请先初始化小游戏适配库

Wechat Lib:1.9.94, 2018.3.15 14:07:52
code.js:107 Warning!,this class[MiniAdpter] already exist: {init: ƒ}
code.js:7132 请先初始化小游戏适配库,详细教程https://ldc.layabox.com/doc/?nav=zh-ts-5-0-0
console.error
Browser.__init__ @ code.js:7132
(anonymous) @ code.js:7057
(anonymous) @ code.js:53348
(anonymous) @ code.js:53360
require @ WAGame.js:3
(anonymous) @ WAGame.js:3
(anonymous) @ game.js? [sm]:2
require @ WAGame.js:3
(anonymous) @ gamePage.html:156
WAGame.js:3 gameThirdScriptError
window.focus is not a function
TypeError: window.focus is not a function
    at Function.Browser.__init__ (http://127.0.0.1:51176/game/code.js:7140:21)
    at Function._$GET_clientWidth (http://127.0.0.1:51176/game/code.js:7057:11)
    at http://127.0.0.1:51176/game/code.js:53348:66
    at http://127.0.0.1:51176/game/code.js:53360:2
    at require (http://127.0.0.1:51176/game/__ ... :13675)
    at http://127.0.0.1:51176/game/__ ... 13424
    at http://127.0.0.1:51176/game/game.js:4:1
    at require (http://127.0.0.1:51176/game/__ ... :13675)
    at http://127.0.0.1:51176/game/gamePage.html:156:80
console.error
errorReport @ WAGame.js:3
thirdErrorReport @ WAGame.js:3
(anonymous) @ WAGame.js:3
(anonymous) @ WAGame.js:9
(anonymous) @ WAGame.js:4
a @ gamePage.html:1
window.onerror
 
    <!--核心包,封装了显示对象渲染,事件,时间管理,时间轴动画,缓动,消息交互,socket,本地存储,鼠标触摸,声音,加载,颜色滤镜,位图字体等-->
    <script type="text/javascript" src="libs/laya.core.js"></script>
        <!--提供了微信小游戏的适配-->
    <script type="text/javascript" src="libs/laya.wxmini.js"></script>
 
_init(): void {
//初始化微信小游戏
        Laya.MiniAdpter.init();
Laya.init(this.stageW, this.stageH, Laya.WebGL)
 已经按官方的写了 但还是不行 也尝试把Laya.MiniAdpter.init(); 放到类外面 也不行 求大神解答
已邀请:

yung

赞同来自:

能否提供一个示例,我们看一下哪地方有问题

Stephen H 小土豆

赞同来自:

我没解决,加个联系方式请教一下?

要回复问题请先

商务合作
商务合作