Comments (6)
Hey @Jimmyzm, thanks for reaching out. The easiest way to get started is to either copy an example or to scaffold a new project using https://batijs.github.io/
Here you can see how the examples glue together Vike (vite-plugin-ssr) with vitejs/plugin-vue: https://github.com/vikejs/vike-vue/blob/main/examples/basic/vite.config.ts
Here is where vike-vue gets plugged into Vike: https://github.com/vikejs/vike-vue/blob/main/examples/basic/pages/%2Bconfig.h.ts#L17
Let me know if anything is unclear. Recently we decided to reduce the readmes to a bare minimum and have them point at https://vite-plugin-ssr.com/ but thanks to this issue and after a conversation with @brillout, we now think the readmes of vike-vue, vike-react and vike-solid should be more elaborated. I'll keep this issue open and work on that (FYI @magne4000)
from vike-vue.
@AurelienLourot , thanks for the reply, what I mean is not about the vitejs/plugin-vue, it's about the plugins made for the vue ecosystem, the usage is here, they need the app instance to take effect before mounted.
from vike-vue.
Ah right, that's not possible yet. I didn't think of it, thanks a lot. I'll add a config option for that.
from vike-vue.
@Jimmyzm I have now implemented a vuePlugins
option that takes a list of plugins with their respective options.
Note
It plays nicely with the ssr
option: if you want SSR it will install the plugin both on the server and on the client. If you don't want SSR it will install it only on the client.
I have created an example on how to install a plugin: https://github.com/vikejs/vike-vue/blob/main/examples/with-vue-plugin/pages/%2BvuePlugins.ts
I still need to:
- Release a new
vike-vue
version so you can make use of that - Properly document all this
- Improve the example to install a real plugin instead of a dummy one
Let me know if there is anything else
from vike-vue.
@AurelienLourot thanks a lot! I just found if I import plugins at the +config.h.ts
file with the vuePlugins
option, It does not work at all because of the doc I found. Not re-exported imports
from vike-vue.
Indeed it's easier to create a +vuePlugins.ts
file than to extend +config.h.ts
. Vike will simply detect +vuePlugins.ts
and use its return value as vuePlugins
config option. This is true for any +<something>.ts
file, by the way, except the special +config.h.ts
file.
from vike-vue.
Related Issues (14)
- `<ClientOnly>` Component HOT 3
- Dependency Dashboard
- Action Required: Fix Renovate Configuration
- Updating `lang` on client-side navigation
- Register plugins that don't use `app.use` HOT 5
- I can't get working examples HOT 3
- Improve DX of ClientOnly component HOT 3
- (Re-)introduce fine-grained head settings HOT 14
- Client side routing with catch all page throwing error HOT 4
- `clientOnly()` function instead of `<ClientOnly>` wrapper component HOT 29
- Progressive Rendering HOT 11
- Nuxt Comparison HOT 4
- Support for `teleports` with Vue SSR HOT 29
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vike-vue.