refactor!: queries
changed from shallowReactive
to reactive
#30
+26
−23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BREAKING CHANGE
queries
从shallowReactive
变成了reactive
,确保queries
能在 SFC template 中能够 auto ref unwrapping。注意
该修改使得
queries
的data, loading, params
等等这些ref
的Return Values
与 VueRequest 的Return Values
取值方式会有所差异。由于
queries
修改为reactive
后,Vue 将会对reactive
对象里的ref
进行展开。因此queries
里面的ref
值不需要再手动加上.value
来获取。而根节点的Return Values
仍旧要加上.value
来取值。修改前
修改后
SFC 示例
更新前,
queries
在 template 中取值要手动添加上.value
更新以后,由于
queries
是reactive
对象,因此不需要加上.value
取值JSX 示例
更新前,
queries
在 JSX 中取值要手动添加上.value
更新以后,由于
queries
是reactive
对象,因此不需要加上.value
取值