Installation
Create a new Vue app with Meteor:.vue) support:
Project Structure
A typical Vue+Meteor app consists of:Basic Setup
HTML Template
Create/client/main.html with the app container:
Client Entry Point
Initialize Vue in/client/main.js:
Root Component
Create/client/App.vue:
Reactive Data Integration
Integrate Meteor’s reactive data system with Vue usingvue-meteor-tracker:
Plugin Setup
Register the plugin in/client/main.js:
Using Meteor Reactivity
Themeteor option in Vue components provides reactive Meteor data:
Collections and Publications
- Collection
- Publication
- Method
- Server
Define a collection in
/imports/collections/Time.js:Router Integration
Vue Router works seamlessly with Meteor:Router Configuration
Using the Router
Server-Side Rendering (SSR)
Meteor supports Vue SSR using theakryum:vue-ssr package:
Basic SSR Setup
In/server/main.js:
SSR with Routing
Async Data Hydration
For components with async data requirements:Client Hydration
In/client/main.js:
Composition API
Vue 3 Composition API works perfectly with Meteor:Best Practices
Remove autopublish
Remove autopublish
Always remove the This ensures you explicitly control what data is published to clients.
autopublish package in production:Use scoped styles
Use scoped styles
Use
<style scoped> in .vue files to prevent style leakage:Leverage reactive cursors
Leverage reactive cursors
Return cursors directly from
meteor helpers for automatic reactivity:Check subscription status
Check subscription status
Use
$subReady to show loading states:Style Guide
Follow both guides for best results:Meteor Style Guide
Meteor’s code style and structure recommendations
Vue Style Guide
Vue’s official style guide and best practices
Resources
Vue Tutorial
Step-by-step tutorial for building Vue apps with Meteor
Vue Meteor Tracker
Integration package for Vue and Meteor reactivity
Vue Documentation
Official Vue 3 documentation and guides
Vue SSR Guide
Server-side rendering with Vue