Skip to content

Commit 438603c

Browse files
re-forteddyerburgh
authored andcommitted
fix: restore temporary change to original config after adding attrs/listeners (#87)
1 parent 6ef437d commit 438603c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/lib/add-attrs.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import Vue from 'vue'
22

33
export default function addAttrs (vm, attrs) {
4+
const originalVueConfig = Vue.config
45
Vue.config.silent = true
56
if (attrs) {
67
vm.$attrs = attrs
78
} else {
89
vm.$attrs = {}
910
}
10-
Vue.config.silent = false
11+
Vue.config.silent = originalVueConfig.silent
1112
}

src/lib/add-listeners.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import Vue from 'vue'
22

33
export default function addListeners (vm, listeners) {
4+
const originalVueConfig = Vue.config
45
Vue.config.silent = true
56
if (listeners) {
67
vm.$listeners = listeners
78
} else {
89
vm.$listeners = {}
910
}
10-
Vue.config.silent = false
11+
Vue.config.silent = originalVueConfig.silent
1112
}

0 commit comments

Comments
 (0)