Releases: vuejs/composition-api
Releases · vuejs/composition-api
v0.6.1
v0.6.0
Great thanks to @pikax for #311, making most of the APIs better aligned with the latest vue-next.
BREAKING CHANGE
- The
lazy
option ofwatch
has been replaced by the oppositeimmediate
option, which defaults to false. (It's ignored when using the effect signature). more details (#266) - Rename
nonReactive
tomarkRaw
watchEffect
now follows the same behaviour as v3 (triggers immediately).UnwrapRef
types fromvue-next
this can cause some incompatibilities.
Bug Fixes
- Added missing reactivity API from vue-next, #311, @pikax
- Fix return type of
toRefs
, #315 - Fix incorrect ref typing, #344, @antfu
- Binding context vm when using function without parentheses, #148, @pikax
- computed: destroy helper vm of computed to prevent memleak, #277, @LinusBorg
- Remove the surplus Function type from PropType, #352, @pikax
Features
- Added
unref
(#309),isReactive
(#327),toRef
(#313),UnwrapRef
(#247) - Added
shallowReactive
,shallowRef
- Added
toRaw
getCurrentInstance
available on the lifecycle hooks (onMounted
, etc)getCurrentInstance
returnsundefined
when called outside setup instead of throwing exception
Types
- Align reactivity types with
vue-next
v0.5.0
v0.4.0
- Refactor: rename
createComponent
todefineComponent
(thecreateComponent
function is still there but deprecated) #230 - Fix: correct the symbol check; fixes the compatibility issue in iOS 9 #218
- Fix: avoid accessing undeclared instance fields on type-level; fixes Vetur template type checking; fixes vue-router type compatibility #189
- Fix:
onUnmounted
should not be run ondeactivated
#217
v0.3.4
v0.3.3
v0.3.2
v0.3.1
v0.3.0
- Improve TypeScript type definitions.
- Fix
context.slots
not being avaliable before render #84.
Changed
The render
function returned from setup
no longer receives any parameters.
Previous
export default {
setup() {
return props => h('div', prop.msg);
},
};
Now
export default {
setup(props) {
return () => h('div', prop.msg);
},
};
v0.2.1
- Declare your expected prop types directly in TypeScript:
import { createComponent, createElement as h } from '@vue/composition-api' interface Props { msg: string } const MyComponent = createComponent<Props>({ props: { msg: {} // required by vue 2 runtime }, setup(props) { return () => h('div', props.msg) } })
- Declare ref type in TypeScript:
const dateRef = ref<Date>(new Date);
- Fix
createComponent
not working withimport()
#81. - Fix
inject
type declaration #83.