Commit 1ccb2235 authored by Enrique Alcántara's avatar Enrique Alcántara Committed by Martin Wortschack

Create static site editor Vue app skeleton

Create basic Vue structure for the static
site editor application
parent ac577f01
import initStaticSiteEditor from '~/static_site_editor';
window.addEventListener('DOMContentLoaded', () => {
initStaticSiteEditor(document.querySelector('#static-site-editor'));
});
import Vue from 'vue';
import StaticSiteEditor from './components/static_site_editor.vue';
import createStore from './store';
const initStaticSiteEditor = el => {
const store = createStore();
return new Vue({
el,
store,
components: {
StaticSiteEditor,
},
render(createElement) {
return createElement('static-site-editor', StaticSiteEditor);
},
});
};
export default initStaticSiteEditor;
import Vuex from 'vuex';
import Vue from 'vue';
import createState from './state';
Vue.use(Vuex);
const createStore = ({ initialState } = {}) => {
return new Vuex.Store({
state: createState(initialState),
});
};
export default createStore;
const createState = (initialState = {}) => ({
content: '',
...initialState,
});
export default createState;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment