create new app vue homepage_widget, with store

This commit is contained in:
Mathieu Jaumotte 2022-01-25 11:27:31 +01:00
parent 320d11671a
commit 0e2772336f
6 changed files with 90 additions and 33 deletions

View File

@ -0,0 +1,16 @@
import { createApp } from 'vue';
import { _createI18n } from 'ChillMainAssets/vuejs/_js/i18n';
import { appMessages } from 'ChillMainAssets/vuejs/HomepageWidget/js/i18n';
import { store } from 'ChillMainAssets/vuejs/HomepageWidget/js/store';
import App from 'ChillMainAssets/vuejs/HomepageWidget/App';
const i18n = _createI18n(appMessages);
const app = createApp({
template: `<app></app>`,
})
.use(store)
.use(i18n)
.component('app', App)
.mount('#homepage_widget')
;

View File

@ -0,0 +1,46 @@
<template>
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">
<i class="fa fa-home"></i>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
Actions d'accompagnement
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
Évaluations
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
Tâches
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
Parcours
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
Notifications
</a>
</li>
</ul>
</template>
<script>
export default {
name: "App"
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,11 @@
const appMessages = {
fr: {
}
};
Object.assign(appMessages.fr);
export {
appMessages
};

View File

@ -0,0 +1,14 @@
import 'es6-promise/auto';
import { createStore } from 'vuex';
const debug = process.env.NODE_ENV !== 'production';
const store = createStore({
strict: debug,
state: {},
getters: {},
mutations: {},
actions: {},
});
export { store };

View File

@ -3,44 +3,13 @@
{# vue component #}
<div id="homepage_widget"></div>
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">
<i class="fa fa-home"></i>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
Actions d'accompagnement
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
Évaluations
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
Tâches
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
Parcours
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
Notifications
</a>
</li>
</ul>
{% include '@ChillMain/Homepage/sticky_button.html.twig' %}
</div>
{% block css %}
{{ encore_entry_link_tags('page_homepage_widget') }}
{% endblock %}
{% block js %}
{{ encore_entry_script_tags('page_homepage_widget') }}
{% endblock %}

View File

@ -53,6 +53,7 @@ module.exports = function(encore, entries)
encore.addEntry('page_login', __dirname + '/Resources/public/page/login/index.js');
encore.addEntry('page_location', __dirname + '/Resources/public/page/location/index.js');
encore.addEntry('page_workflow_show', __dirname + '/Resources/public/page/workflow-show/index.js');
encore.addEntry('page_homepage_widget', __dirname + '/Resources/public/page/homepage_widget/index.js');
buildCKEditor(encore);