javascript - When using preloadjs to load files in vue, the fileload event is invalid, causing the complete event to be invalid as well
大家讲道理
大家讲道理 2017-06-12 09:27:52
0
1
1065

Need to load some pictures and audio resources, the pseudo code is as follows:

data () {
    assets: []  
},
methods :{
    getAssets () {
        var que = new createjs.LoadQueue(true);
        que.setMaxConnections(5);
        que.on('fileload', this.handleFileLoad, this);
        que.on('complete', this.createLoading, this);
    },
    handleFileLoad (event) {
        this.assets[event.item.id] = event; //这里根本进不来
    },
    createLoading (e) {
        // ...
    }
}

I don’t know if it is a problem with this passed in the vuecomponent object. Please solve it.

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(1)
滿天的星座

Try changing the third parameter this to window

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!