Commit e12ea175 authored by Jérémie Passerat's avatar Jérémie Passerat

Ajout d'un composant de login

parent ddd38673
...@@ -6694,6 +6694,16 @@ ...@@ -6694,6 +6694,16 @@
"integrity": "sha512-JVAfqNPTvNq3sB/VHQJAFxN/sPgKnsKrCwyRt15zwNCdrMMJDdcEOdubuy+DuJYYdm0ox1J4uzEuYKkN+9yhVg==", "integrity": "sha512-JVAfqNPTvNq3sB/VHQJAFxN/sPgKnsKrCwyRt15zwNCdrMMJDdcEOdubuy+DuJYYdm0ox1J4uzEuYKkN+9yhVg==",
"dev": true "dev": true
}, },
"jquery": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz",
"integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw=="
},
"jquery-ui-bundle": {
"version": "1.12.1-migrate",
"resolved": "https://registry.npmjs.org/jquery-ui-bundle/-/jquery-ui-bundle-1.12.1-migrate.tgz",
"integrity": "sha1-uTQ+LDEHQ1J2Ms/4vtsMXpYAsUw="
},
"js-message": { "js-message": {
"version": "1.0.7", "version": "1.0.7",
"resolved": "https://registry.npmjs.org/js-message/-/js-message-1.0.7.tgz", "resolved": "https://registry.npmjs.org/js-message/-/js-message-1.0.7.tgz",
...@@ -10848,6 +10858,11 @@ ...@@ -10848,6 +10858,11 @@
"resolved": "https://registry.npmjs.org/vue/-/vue-2.6.12.tgz", "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.12.tgz",
"integrity": "sha512-uhmLFETqPPNyuLLbsKz6ioJ4q7AZHzD8ZVFNATNyICSZouqP2Sz0rotWQC8UNBF6VGSCs5abnKJoStA6JbCbfg==" "integrity": "sha512-uhmLFETqPPNyuLLbsKz6ioJ4q7AZHzD8ZVFNATNyICSZouqP2Sz0rotWQC8UNBF6VGSCs5abnKJoStA6JbCbfg=="
}, },
"vue-cookies": {
"version": "1.7.4",
"resolved": "https://registry.npmjs.org/vue-cookies/-/vue-cookies-1.7.4.tgz",
"integrity": "sha512-mOS5Btr8V9zvAtkmQ7/TfqJIropOx7etDAgBywPCmHjvfJl2gFbH2XgoMghleLoyyMTi5eaJss0mPN7arMoslA=="
},
"vue-eslint-parser": { "vue-eslint-parser": {
"version": "7.6.0", "version": "7.6.0",
"resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.6.0.tgz", "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.6.0.tgz",
......
...@@ -9,7 +9,10 @@ ...@@ -9,7 +9,10 @@
}, },
"dependencies": { "dependencies": {
"core-js": "^3.6.5", "core-js": "^3.6.5",
"vue": "^2.6.11" "jquery": "^3.6.0",
"jquery-ui-bundle": "^1.12.1-migrate",
"vue": "^2.6.11",
"vue-cookies": "^1.7.4"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0", "@vue/cli-plugin-babel": "~4.5.0",
......
...@@ -13,14 +13,6 @@ export default { ...@@ -13,14 +13,6 @@ export default {
components: { components: {
Volet_Base Volet_Base
}, },
created() {
alert('prpr')
},
data: function () {
return {
userLogged: true
}
},
} }
</script> </script>
......
<template> <template>
<div> <div>
<Login v-show="!userLogged" @isLogged="setLogged"></Login> <Login v-show="!userLogged" @user_logged="setLogged"></Login>
<App v-show="userLogged"></App> <App v-show="userLogged" ></App>
</div> </div>
</template> </template>
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<script> <script>
import Login from "@/Login"; import Login from "@/Login";
import App from "@/App"; import App from "@/App";
export default { export default {
name: "Index.vue", name: "Index.vue",
data: function () { data: function () {
...@@ -19,9 +20,13 @@ export default { ...@@ -19,9 +20,13 @@ export default {
}, },
methods: { methods: {
setLogged: function () { setLogged: function () {
//this.$cookies.set("isLogged", true)
this.userLogged = true this.userLogged = true
} }
}, },
created() {
//this.userLogged = this.$cookies.get("isLogged")
},
components:{ components:{
Login, Login,
App App
......
<template> <template>
<div> <div>
<p> AYAYAYAYAY </p> <form>
<form v-on:submit="logIn()">
<label for="identifiant">Identifiant</label> <label for="identifiant">Identifiant</label>
<br> <br>
...@@ -15,7 +14,7 @@ ...@@ -15,7 +14,7 @@
<br> <br>
<br> <br>
<input type="submit" value="connexion"> <button value="connexion" @click.prevent="logIn"/>
</form> </form>
</div> </div>
...@@ -29,8 +28,8 @@ export default { ...@@ -29,8 +28,8 @@ export default {
methods: { methods: {
logIn: function () { logIn: function () {
this.$emit("isLogged", {isLogged: true}) this.$cookies.set("isLogged", true)
this.$emit("user_logged", {"isLogged" : true})
} }
}, },
data: function () { data: function () {
......
import Vue from 'vue' import Vue from 'vue'
import App from './App.vue' import Index from '@/Index'
import VueCookies from 'vue-cookies'
//import Index from '@/Index' //import Index from '@/Index'
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.use(VueCookies);
new Vue({ new Vue({
render: h => h(App), VueCookies,
render: h => h(Index),
}).$mount('#app') }).$mount('#app')
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