There was an error while loading. Please reload this page.
1 parent 51515b3 commit 363e5e5Copy full SHA for 363e5e5
test/index.js
@@ -1048,3 +1048,28 @@ test("$asyncComputed[name].state resolves to 'success' even if the computed valu
1048
t.equal(vm.isUpdating, false)
1049
})
1050
1051
+
1052
+test("$asyncComputed[name].update does nothing if called after the component is destroyed", t => {
1053
+ t.plan(4)
1054
+ let i = 0
1055
+ const vm = new Vue({
1056
+ asyncComputed: {
1057
+ a: {
1058
+ async get () {
1059
+ return ++i
1060
+ }
1061
1062
1063
+ })
1064
1065
+ t.equal(vm.a, null)
1066
+ Vue.nextTick(() => {
1067
+ t.equal(vm.a, 1)
1068
+ vm.$destroy()
1069
+ vm.$asyncComputed.a.update()
1070
1071
+ t.equal(i, 1)
1072
1073
1074
1075
+})
0 commit comments