Created
October 29, 2016 19:11
-
-
Save xtrasmal/2f7e90a5fb8595901337df64ac987393 to your computer and use it in GitHub Desktop.
Vue 2.0 start
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue'; | |
import store from './store'; | |
// Load root component | |
if(elementIsFound("application")) { | |
new Vue({ | |
store, | |
name: 'Your application', | |
components: { | |
pages: require('./components/pages') | |
} | |
}).$mount('#application'); | |
} | |
// Load an event bus | |
window.Bus = new Vue(); | |
// Helpers | |
function elementIsFound(element) { | |
return document.body.contains(document.getElementById(element)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"private": true, | |
"scripts": { | |
"prod": "gulp --production", | |
"dev": "gulp watch" | |
}, | |
"devDependencies": { | |
"aliasify": "^2.0.0", | |
"babel-core": "^6.18.0", | |
"babel-plugin-transform-runtime": "^6.15.0", | |
"babel-preset-es2015": "^6.18.0", | |
"babel-preset-stage-2": "^6.18.0", | |
"babelify": "^7.3.0", | |
"bootstrap-sass": "^3.3.7", | |
"browserify-hmr": "^0.3.5", | |
"gulp": "^3.9.1", | |
"jquery": "^3.1.0", | |
"laravel-elixir": "^6.0.0-11", | |
"laravel-elixir-browserify-official": "^0.1.3", | |
"laravel-elixir-browsersync-official": "^1.0.0", | |
"laravel-elixir-rollup-official": "^1.1.0", | |
"laravel-elixir-vue-2": "^0.2.0", | |
"laravel-elixir-webpack-official": "^1.0.2", | |
"lodash": "^4.16.2", | |
"vue": "^2.0.1", | |
"vue-resource": "^1.0.3", | |
"vue-router": "^2.0.1" | |
}, | |
"dependencies": { | |
"babel-plugin-transform-object-rest-spread": "^6.16.0", | |
"sortablejs": "^1.4.2", | |
"turbolinks": "^5.0.0", | |
"vuex": "^2.0.0" | |
}, | |
"browserify": { | |
"transform": [ | |
"babelify", | |
"aliasify" | |
] | |
}, | |
"aliasify": { | |
"aliases": { | |
"vue": "vue/dist/vue" | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue'; | |
import Vuex from 'vuex'; | |
Vue.use(Vuex); | |
const store = new Vuex.Store({ | |
strict: true | |
}); | |
export default store |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment