Skip to content

Instantly share code, notes, and snippets.

import Vue from 'vue';
import App from 'components/app';
new Vue({
el: 'body',
components: { App },
});
if (Meteor.isClient) {
Meteor.startup(() => {
new Vue({
el: 'body',
});
});
}
let Todos = new Mongo.Collection('todos');
let App = Vue.component('app', {
template: '#app',
data() {
return {
todos: []
}
},
created() {
Tracker.autorun( () => this.todos = Todos.find().fetch() );
<head>
<title>meteor-vue-todo</title>
</head>
<body>
<app></app>
<template id="app">
<div class="app">
<h1>Meteor Vue Todos</h1>
let Todos = new Mongo.Collection('todos');
if (Meteor.isClient) {
let App = Vue.component('app', {
template: '#app',
data() {
return {
todos: [],
newTodo: ''
}
var elixir = require('laravel-elixir');
elixir.config.assetsPath = 'src';
elixir.config.publicPath = 'dist';
elixir(function(mix) {
mix.browserSync({
files: ['**/*.html', '**/*.css', '**/*.js']
});
mix.browserify('app.js');
mix.sass('app.scss');