Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何加载本地项目资源,例如json,本地图片? #114

Closed
huiruo opened this issue Aug 20, 2021 · 3 comments
Closed

如何加载本地项目资源,例如json,本地图片? #114

huiruo opened this issue Aug 20, 2021 · 3 comments

Comments

@huiruo
Copy link

huiruo commented Aug 20, 2021

Expected Behavior

resource.addResource([
    {
        name: 'imageName',
        type: RESOURCE_TYPE.IMAGE,
        src: {
            image: {
                type: 'png',
                url: 'https://gw.alicdn.com/tfs/TB1DNzoOvb2gK0jSZK9XXaEgFXa-658-1152.webp',
                // url:'./test_png.webp',
            },
        },
        preload: true,
    },
]);

Current Behavior

Possible Solution

Steps to Reproduce

Environment

  • Eva.js version: e.g. 1.0.0
  • Browser & Version: e.g. Chrome 67
  • OS & Version: e.g. MacOS 10.15.7
  • Running Example: url
@fanmingfei
Copy link
Member

这和在正常页面中访问本地资源没有什么区别。eva.js不会对你输入的路径进行改变。

@ai-blib
Copy link

ai-blib commented Aug 25, 2021

是根据你打包后,的资源相对路径来取的。

@huiruo
Copy link
Author

huiruo commented Aug 25, 2021

是根据你打包后,的资源相对路径来取的。

懂了,我应该是放到未打包的路径导致读取不了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants