sourcecode

vuex 작업에서 반환된 약속에 final() 메서드가 firefox에 없습니다.

copyscript 2022. 8. 10. 22:15
반응형

vuex 작업에서 반환된 약속에 final() 메서드가 firefox에 없습니다.

Chrome에서 vuex 작업 중 하나를 사용하면 항상 메서드를 포함하는 Promise 개체가 반환됩니다..catch(),.then()그리고..finally()파이어폭스(버전 60.0.2)에서도 같은 처리를 하면 단순한 오브젝트가 표시됩니다.{}) 메서드만 있습니다..catch()그리고..then()하지만 아니다.finally()네이티브 Promise 오브젝트가 아닌 이 의사 오브젝트가 표시되는 이유는 무엇입니까?Firefox는 이 기능을 지원하므로 특히 번거로우시겠지만finally()버전 58 이후입니다.

actions.syslog

doBla: ({commit}) => {
    axios.post('http://test', {})
        .then(result => {
            commit('bla', result.data);
        });
}

test.vue

...
import { mapActions } from 'vuex';
export default {
    methods: {
        ...mapActions(['doBla']),
        test() {
            const r = this.doBla();
            console.log(r); // no function finally
            r.then(() => {
            })
            .finally(() => {}); // Crashes because of missing function in Firefox
        }
    }
}

언급URL : https://stackoverflow.com/questions/50965439/promise-returned-by-vuex-action-does-not-have-finally-method-in-firefox

반응형