mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-25 00:53:48 +00:00
controller return json to vue via twig; init vue App
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<template>
|
||||
hello
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex';
|
||||
|
||||
export default {
|
||||
name: "App",
|
||||
components: {},
|
||||
computed: mapState([
|
||||
'activity'
|
||||
])
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
@@ -0,0 +1,8 @@
|
||||
const appMessages = {
|
||||
fr: {
|
||||
|
||||
}
|
||||
}
|
||||
export {
|
||||
appMessages
|
||||
};
|
@@ -0,0 +1,16 @@
|
||||
import { createApp } from 'vue';
|
||||
import { _createI18n } from 'ChillMainAssets/vuejs/_js/i18n'
|
||||
import { appMessages } from './i18n'
|
||||
import store from './store'
|
||||
|
||||
import App from './App.vue';
|
||||
|
||||
const i18n = _createI18n(appMessages);
|
||||
|
||||
const app = createApp({
|
||||
template: `<app></app>`,
|
||||
})
|
||||
.use(store)
|
||||
.use(i18n)
|
||||
.component('app', App)
|
||||
.mount('#activity');
|
||||
|
@@ -0,0 +1,31 @@
|
||||
import 'es6-promise/auto';
|
||||
import { createStore } from 'vuex';
|
||||
|
||||
const debug = process.env.NODE_ENV !== 'production';
|
||||
//console.log('window.activity', window.activity);
|
||||
|
||||
const store = createStore({
|
||||
strict: debug,
|
||||
state: {
|
||||
activity: window.activity
|
||||
},
|
||||
getters: {
|
||||
|
||||
},
|
||||
mutations: {
|
||||
addPerson(state, payload) {
|
||||
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
addPerson() {
|
||||
//let el = document.getElementById('form['activity']['xxx']['xxxx']');
|
||||
//let option = document.createElement('option');
|
||||
//option.value = person.id;
|
||||
//el.appendChild(option);
|
||||
commit('addPerson', payload)
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export default store;
|
Reference in New Issue
Block a user