Skip to content

Instantly share code, notes, and snippets.

View shentao's full-sized avatar

Damian Dulisz shentao

View GitHub Profile
@shentao
shentao / VueEventBus.js
Last active June 15, 2018 18:24
Vue EventBus Example
// EventBus.js
export const eventBus = new Vue()
// FileA.js
import { EventBus } from './EventBus'
const x = 'my param'
EventBus.$emit('event-name', x)
@shentao
shentao / todo.spec.js
Created September 10, 2016 12:34
Testing with props in vue.js 2.0
import Vue from 'vue'
import Todo from 'src/components/Todo'
describe('Todo component', () => {
let vm = null
let todo = null
beforeEach(() => {
vm = new Vue({
render (h) {
var isFunction = function(o) {
return typeof o === 'function';
};
var bind,
slice = [].slice,
proto = Function.prototype,
featureMap;
featureMap = {