Vue.js starter

Для старта проекта

/*
 * VUE plugin Глобальный плагин
 */
var VuePlugin = function install(Vue, options) {

     Vue.pluginTestMethod = function () {
         return 'VuePlugin > pluginTestMethod';
     }, 
};
Vue.use(VuePlugin);

/*
 * VUE Store Глобальное хранилище
 */
var store = new Vuex.Store({
    state: {
        Url: '',       
    },
    mutations: {
        setUrl: function (state, val) {
            state.Url = val;
        },
    actions: {},    
    getters: {},  
    modules: {}	
    }
});


/*
 * VUE Component
 */
var customComponent = Vue.component('customComponent', {
    template: '<span>customComponent</span>',
    props: {       
    },
    data: function () {
        return {}
    },
    created: function() {      
    },   
    mounted: function () {      
    },
    updated: function() {           
    },
    methods: { 
    },
    events: {
    },
    watch:  {
    },
    computed: {      
    }
});

/*
 * VUE Main App
 */
var vm = new Vue({
    el: "#app",
    data: { 
    },
	store: store,
    components: {
        'customComponent': customComponent
    },
    created: function () { 
		store.commit('setUrl', 'http://');
    },   
    mounted: function() {        
    },
    updated: function() {     
    },
    events: {       
    },
    watch:  {        
    },
    methods:  { 
		risePluginTestMethod: function(){
			return Vue.pluginTestMethod();
		}
    },
    computed: {
    },
    filters: {        
    }
});

 

Добавить комментарий

Loading