✌️ Vue Options API To Composition API Migration Cheat Sheet

Tom Smykowski
3 min readJan 23, 2023

Below is a cheat sheet to move easily from Options API to Composition API in Vue. First script is “before”, and second: “after”:

Script

<script lang="ts">
export default {
data() {
return {
showHeaderMenu: false,
}
},
methods() {
toggleHeaderMenu() {
this.showHeaderMenu =
!this.showHeaderMenu…

--

--

Tom Smykowski

I'm on a mission to have 20 000 followers. Help me achieve this goal and become one!