Composition API RFC Release Note - ChoDragon9/posts GitHub Wiki
::: tip
@vue/composition-api์ ๋ฆด๋ฆฌ์ฆ ๋
ธํธ๋ฅผ ํตํด ์ด๋ค ๋ณ๊ฒฝ ์ฌํญ์ด ์๊ธธ์ง ์์ํ๊ธฐ ์ํด ์ ๋ฆฌํ ํฌ์คํธ์
๋๋ค.
:::
- [๋ฆฌํฉํ ๋ง] ์ด๋ฆ๋ณ๊ฒฝ
createComponent=>defineComponent - [๋ผ์ดํ์ฌ์ดํด]
onUnmounted์ ํธ์ถ ์์ ์ดdestroyed์deactivated=>destroyed๋ก ๋ณ๊ฒฝ #217
- [๋ผ์ดํ์ฌ์ดํด]
onServerPrefetch์ถ๊ฐ - [์ปจํ
์คํธ]
ssrContext์ถ๊ฐ - [TypeScript] computed type ์ด์ ํด๊ฒฐ
- [TypeScript]
props์ต์ ํ์ ์ถ๋ก ๊ฐ์
- [Fix] watcher ์ฝ๋ฐฑ์ด ์ ์์ ์ธ ์์ ์ ํด์ ์๋๋ ํ์ ํด๊ฒฐ
- [TypeScript] TypeScript ํ์ ์ ์ ๊ฐ์
- [์ปจํ
์คํธ]
context.slots๊ฐ render์ ์ ์ฌ์ฉํ ์ ์๋ ํ์ ํด๊ฒฐ
- [TypeScript] prop ํ์ ์ ์ง์ ์ ์ธ ๊ฐ๋ฅํจ
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)
}
})- [TypeScript] ref ํ์ ์ ์ธ
const dateRef = ref<Date>(new Date);- [๋ฆฌํฉํ ๋ง] ์ด๋ฆ ๋ณ๊ฒฝ
onBeforeDestroy()=>onBeforeUnmount() - [๋ผ์ดํ์ฌ์ดํด]
onCreated(),onDestroyed์ ๊ฑฐ
- RFC๋ก ๋๋ฉด์ ํจํค์ง ์ด๋ฆ ๋ณ๊ฒฝ๋จ