Overview
This example shows:- Menu item registration
- Component section injection
- Action button implementation
- Notification handling
- Location-based rendering
Project Structure
Complete Code
Entry Point
src/frontend/main.ts
Extension Registration
src/frontend/init/init-app.ts
Location Renderer
src/frontend/locations/init-locations.ts
Chart Card Component
src/frontend/locations/views/ChartCard.vue
Data Example Component
src/frontend/locations/views/DataExample.vue
Resize Example Component
src/frontend/locations/views/ResizeExample.vue
Development Server
src/server.ts
Package Configuration
package.json
Running the Example
custom/apps/BasicAdminApp/Expected Output
Dashboard Card
On the dashboard, you’ll see a new card titled “Meteor Admin SDK” with:- Welcome message
- Button to show notifications
Menu Item
A new menu item appears in the navigation with a searchable page.Product Detail Tab
When viewing a product:- New “Example” tab appears
- Two cards with interactive examples:
- Data handling with subscribe/get buttons
- Resize testing with dynamic content
Product List Action
When viewing the product list:- Select one or more products
- Click the “Example action button”
- See notification with selected product IDs
Key Takeaways
- Location-based rendering: Use
location.is()to differentiate between registration and rendering - Async components: Load views dynamically with
defineAsyncComponent - Component library: Use Meteor Component Library for consistent UI
- Notifications: Provide user feedback with
notification.dispatch() - Data access: Use
data.get()anddata.subscribe()for real-time data