vikejs / vike

🔨 Flexible, lean, community-driven, dependable, fast Vite-based frontend framework.

Home Page:https://vike.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Examples + vike-vue: use composition API to support composition-only build of vue

jonaskuske opened this issue · comments

Description

Something I stumbled upon some time ago:
The examples and vike-vue use the options API to define the root component & integrate it with routing: https://github.com/vikejs/vike/blob/main/examples/vue-full/renderer/app.ts

Because of this, the app breaks when you set _VUE_OPTIONS_API_: false, a compile-time flag to exclude code related to the options API and reduce bundle size. Using the composition API is just a tiny change (using a ref instead of data() for this.Page), happy to submit a PR :)

commented

happy to submit a PR :)

I was actually about to ask whether that's something you'd be up for :)

Looking forward to it.

This repo uses composition API: https://github.com/royalswe/vike-fastify-boilerplate/blob/main/renderer/app.ts
Feel free to copy code if needed.