First commit :)

This commit is contained in:
RemiSaurel
2022-06-05 01:02:07 +02:00
parent 8c22caa124
commit 04417476b3
4 changed files with 171 additions and 69 deletions
-58
View File
@@ -1,58 +0,0 @@
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br>
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
</ul>
<h3>Essential Links</h3>
<ul>
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
</ul>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
+93
View File
@@ -0,0 +1,93 @@
<template>
<div id="todolist">
<input @keydown.enter="addItem(item)" type="text" name="todo" id="todo_input" v-model="item"
placeholder="Insérer votre todo">
<div id="liste">
<div v-for="item in items" :key="item.id" class="item">
<div id="text">
{{item}}
</div>
<div @click="removeItem(item)" id="trash">
🗑
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "ToDoList",
components: {},
data() {
return {
item: "",
items: []
}
},
methods: {
addItem(item) {
if (item.trim() !== "") {
this.items.push(item)
this.item = ""
}
},
removeItem(item) {
this.items = this.items.filter(e => e !== item)
this.item = ""
}
}
}
</script>
<style scoped>
#todolist {
text-align: center;
}
#todo_input {
font-size: 1.2rem;
width: 50%;
max-width: 400px;
padding: 12px 20px;
margin: 8px 0;
box-sizing: border-box;
border-radius: 16px;
border: 2px solid saddlebrown;
}
#todo_input:focus {
outline: none !important;
border: 2px solid #8783D1;
}
#liste {
display: flex;
flex-direction: column;
}
.item {
display: flex;
font-size: 18px;
margin-top: 8px;
align-items: center;
padding: 8px 10px 8px 10px;
border-radius: 12px;
max-width: 50vw;
box-shadow: rgba(111, 111, 111, 0.2) 0px 7px 29px 0px;
margin-left: auto;
margin-right: auto;
word-break: break-all;
}
.item:hover {
box-shadow: #ff0000 0px 1px 6px 0px;
}
#trash {
font-size: 20px;
padding: 8px;
cursor: pointer;
}
</style>
+19
View File
@@ -0,0 +1,19 @@
<template>
<div class="hello">
<h1>ToDoList</h1>
</div>
</template>
<script>
export default {
name: 'Welcome',
props: {
}
}
</script>
<style scoped>
.hello {
text-align: center;
}
</style>