Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

使用progress监听不到变化的过程,直接返回100% #711

Open
shihaha opened this issue Nov 16, 2018 · 0 comments
Open

使用progress监听不到变化的过程,直接返回100% #711

shihaha opened this issue Nov 16, 2018 · 0 comments

Comments

@shihaha
Copy link

shihaha commented Nov 16, 2018

相关代码块儿如下:

this.$http.post('/api/XXX', this.XXX, {
    progress: progressEvent => {
        if (progressEvent.lengthComputable) {
            this.$nextTick(() => {
                // this.percent = Math.ceil((progressEvent.loaded / progressEvent.total) * 100);
                console.log(Math.ceil((progressEvent.loaded / progressEvent.total) * 100));
            })
        }
    }
}).then(({ data: { code, data, message } }) => {

只能打印出100,没有progress的变化过程,请问该怎么改?

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

No branches or pull requests

1 participant