You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It just return the parent object. Maybe it should be replaced by code like this
strats.props =
strats.methods =
strats.computed = function (parentVal: ?Object, childVal: ?Object): ?Object {
if (!childVal) return extend({}, parentVal)
There is a same problem for strats.watch in line 158.
There is no need to change strats.data in line 69 because the type is function.
I'd like to submit a PR but I'm not familiar with the code, like that props could be a Array so more things should be done after `extend({}, parentVal)...
Hope someone can fix this bug, Thanks!
Actually, it is not commonly used to set Sub.options.computed directly, but I met this bug when using vue-loader with css module. For example:
And finally, you will find that the computed property $style of <my-base> has been replaced by the one of <my-sub>. They share the same $style in fact.
The following lines using options directly are in vue-loader:
__vue_options__ = __vue_options__.options in line 254, vue-loader/lib/loader.js
__vue_options__.computed[key] = function () { return module } in line 285
And with the mentioned bug above in vue cause the final problem.
The text was updated successfully, but these errors were encountered:
A simple case:
The reason has been found, in line 181,
vue/src/core/util/options.js
It just return the parent object. Maybe it should be replaced by code like this
There is a same problem for
strats.watch
in line 158.There is no need to change
strats.data
in line 69 because the type isfunction
.I'd like to submit a PR but I'm not familiar with the code, like that
props
could be a Array so more things should be done after `extend({}, parentVal)...Hope someone can fix this bug, Thanks!
Actually, it is not commonly used to set
Sub.options.computed
directly, but I met this bug when using vue-loader with css module. For example:base.vue
sub.vue
And finally, you will find that the computed property
$style
of<my-base>
has been replaced by the one of<my-sub>
. They share the same$style
in fact.The following lines using options directly are in vue-loader:
__vue_options__ = __vue_options__.options
in line 254,vue-loader/lib/loader.js
__vue_options__.computed[key] = function () { return module }
in line 285And with the mentioned bug above in vue cause the final problem.
The text was updated successfully, but these errors were encountered: