Skip to content

Latest commit

 

History

History
95 lines (74 loc) · 1.58 KB

TEMPLATES.md

File metadata and controls

95 lines (74 loc) · 1.58 KB

Code Templates

For HTML, check pattern_library_public.html.twig & pattern_library_admin.html.twig

Vue

Vue Component

<template>

</template>

<script>
export default {
    components: {},
    
    props: {},

    data () {
        return {};
    },

    computed: {},

    watch: {},

    beforeMount () {},

    mounted () {},

    methods: {},
}
</script>

Vue Store

const state = {
};

const getters = {
    // getter (state, getters) {
    //     return state.param;
    // },
    // getter: (state) => (value) => {
    //     return state.param[value];
    // },
};

const actions = {
    // action ({ commit, state, dispatch, rootState, rootGetters }, data) {
    //     commit('mutation');
    // },
};

const mutations = {
    // mutation (state, param) {
    //     state.param = param;
    // },
};

export default {
    namespaced: true,
    state,
    getters,
    actions,
    mutations
}

Vue Router

import VueRouter from 'vue-router';

const router = new VueRouter({
    mode: 'history',
    routes: [
        {
            name: null,
            path: null,
            component: null,
        },
    ],

    scrollBehavior (to, from, savedPosition) {
        if (savedPosition) {
            return savedPosition
        } else {
            return { x: 0, y: 0 }
        }
    },
});

export default router;