Closed chinanf-boy closed 6 years ago
https://github.com/pagekit/vue-resource/blob/develop/src/http/index.js#L24
vue-resource:v1.5.0
defaults(options || {}, self.$options, Http.options);
if you can make options always True, then || {} is usefulness
options
True
|| {}
when !!options is Flase, {} put the defaults({},..) function, but return target no catch
!!options
Flase
{}
defaults({},..)
target
https://github.com/pagekit/vue-resource/blob/develop/src/util.js#L155 - return target
return target
options = defaults(options || {}, self.$options, Http.options);
Request will use options, but seem like in 2, !options is False
2
!options is False
https://github.com/pagekit/vue-resource/blob/develop/src/http/index.js#L38
return client(new Request(options)).then(response => {
So , a way is Add options = defaults(options || {}, self.$options, Http.options);
or Just del {} > defaults(options, self.$options, Http.options);
defaults(options, self.$options, Http.options);
Hope that ISSUE is useful😊!!
Reproduction Link
https://github.com/pagekit/vue-resource/blob/develop/src/http/index.js#L24
Steps to reproduce
defaults(options || {}, self.$options, Http.options);
if you can make
options
alwaysTrue
, then|| {}
is usefulnesswhen
!!options
isFlase
,{}
put thedefaults({},..)
function, but returntarget
no catchoptions = defaults(options || {}, self.$options, Http.options);
What is Expected?
Request will use
options
, but seem like in2
,!options is False
https://github.com/pagekit/vue-resource/blob/develop/src/http/index.js#L38
return client(new Request(options)).then(response => {
What is actually Way?
So , a way is Add
options = defaults(options || {}, self.$options, Http.options);
or Just del {} >
defaults(options, self.$options, Http.options);