We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e809b03 commit 2b67eecCopy full SHA for 2b67eec
src/core/instance/state.js
@@ -112,6 +112,14 @@ const computedSharedDefinition = {
112
113
function initComputed (vm: Component, computed: Object) {
114
for (const key in computed) {
115
+ /* istanbul ignore if */
116
+ if (process.env.NODE_ENV !== 'production' && key in vm) {
117
+ warn(
118
+ `existing instance property "${key}" will be ` +
119
+ `overwritten by a computed property with the same name.`,
120
+ vm
121
+ )
122
+ }
123
const userDef = computed[key]
124
if (typeof userDef === 'function') {
125
computedSharedDefinition.get = makeComputedGetter(userDef, vm)
0 commit comments