从数字到字符串

时间:2017-11-24 07:51:17

标签: javascript

我用TypeScript编写代码如下:

private initModel = () => {
    let brandGoodId: number;

    const getBrandGoodIdFunction = (window.parent as any).auditDisplay;
    if (getBrandGoodIdFunction) {
        brandGoodId = getBrandGoodIdFunction().brandGoodId;
        console.log('get brandGoodId', brandGoodId);
    } else {
        console.log('window.auditDisplay is undefined!');

        return;
    }

    getDisplayInfosByBgids(brandGoodId).then((displayInfoMap) => {
        const displayInfo: DisplayInfo = (displayInfoMap.get(brandGoodId) as DisplayInfo);

        this.modelInfo = toPopBufferComponent(displayInfo.components[0]);

        this.loadModelMesh();
    });
}

我有一个名为brandGoodId的变量,它应该是let brandGoodId: number;显示的数字。

但是当我测试已编译的js时,它会显示string,如下所示: enter image description here

编译后发生了什么?我想这是贝尔的问题?

0 个答案:

没有答案