大约有 2,054 项符合查询结果, 库内数据总量为 30,723 项。 (搜索耗时: 0.0057 秒)
... QZONE 微信 nevercai 赞同来自: 你需要把命名空间也导出。 export namespace global2 { ...... 在使用的地方import {global2} from "......" BTW:这样的命名空间不好用,你多个文件同一个命名空间,你import的时候就会有问题。 你可以单独创...
来源: Laya_社区 发布时间: 20190302
...import View=Laya.View; import Dialog=Laya.Dialog; import Scene=Laya.Scene; export module ui { export class AttackUI extends View { public btn_attack:Laya.Button; constructor(){ super()} createChildren():void { super.createChildren(); this.loadScene("Attack"); } } } 扩展UI代码: import { ui }...
来源: Laya_社区 发布时间: 20180926
...ts文件,在文件内创建namespace,如下: namespace MyNamespace { export class MyClass { // TODO. } }在main.ts的构造函数中,总是报错,提示 MyNamespace is not defined, 但是,如果我不用新文件,把这段定义放在main.ts内,就不会报错,请问如何引用...
来源: Laya_社区 发布时间: 20180918
...分离模式里面扩展一个场景类,老是提示 Error: 'ui' is not exported 刚刚学laya不久,比较初级问题。最新的版本2.7创建一个2D的js的demo.然后选择分离模式。自动生成了一个TestSceneUI。 我现在想继承这个类,创建了TestSceneExtend,把自动...
来源: Laya_社区 发布时间: 20200630
...; import Dialog=Laya.Dialog; var REG: Function = Laya.ClassUtils.regClass; export module ui { export class MainSceneUI extends Laya.SceneBase { constructor(){ super()} createChildren():void { super.createChildren(); this.loadScene("MainScene"); } } REG("ui.MainSceneUI",MainSceneUI); } 期待生成Sc...
来源: Laya_社区 发布时间: 20190418
...文件引用顺序不正确,我今天试了下,可以使用ts的import/export处理这个问题 一、调试 修改tsconfig.json,把module和target都改为ES6,因为es6的语法和ts很像,调试的时候看es6就可以了,索性把sourceMap也关掉{ "compilerOptions": { "module": "ES6...
来源: Laya_社区 发布时间: 20171120
...语法,但是ES6请谨慎使用,目前的浏览器基本上都不支持export import的使用! 2017-09-23 0 4 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 要回复问题请先登录 发起人 zhishaofei3 相关问题 预设怎么在代码中使用 这样写的代码,T...
来源: Laya_社区 发布时间: 20170922
... = Laya.Browser; import Handler = Laya.Handler; import WebGL = Laya.WebGL; export class Main { private ApePath: string = "../../res/apes/monkey2.png"; private apeTexture: Texture; constructor() { // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); L...
来源: Laya2.0_文档 发布时间: 20210715
...import View=Laya.View; import Dialog=Laya.Dialog; import Scene=Laya.Scene; export module ui { export class BGPageUI extends View { constructor(){ super()} createChildren():void { super.createChildren(); this.loadScene("BGPage"); } } export class MonkeyPageUI extends View { constructor(){ super()} cr...
来源: Laya_社区 发布时间: 20181014
...道这里我还的Import 20+次? 而且被导入文档 首行必须有 export default class******* 这升级后 怎么写起来更麻烦了?还是说我没找到简便方式?? 求解 图1: 图2 问题二: 例如1.9我可以这样使用带命名空间的文档,,但是由于2.0需...
来源: Laya_社区 发布时间: 20181112