cocos / cocos-docs

Manual docs content for Cocos Creator
https://docs.cocos.com
307 stars 462 forks source link

docs issue at: 文本资源 #3055

Open crater-xin opened 1 month ago

crater-xin commented 1 month ago

filePath: zh/asset/text.md content:

loadPCD(url: string) {  
    resources.load(url, (err, asset: TextAsset) => {  
        if (err) {
            console.error('Failed to load PCD file');
            console.error(err);
            return;  
        }
        console.log(asset);
        console.log(asset.text);
        console.log(asset._file);

        // const text: string = asset.text;  
        // this.parsePCD(text);  
    });  
}  

加载pcd文本文件,加载到的资源中,text是undefined,而_file中有值,但是编辑器报错,——file受保护