learnin-some-vue/index.html

42 lines
903 B
HTML
Raw Normal View History

2018-04-13 14:54:53 +00:00
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
2018-04-13 17:13:11 +00:00
<script src="vue.js"></script>
2018-04-13 18:55:09 +00:00
<link rel="stylesheet" href="style.css">
2018-04-13 14:54:53 +00:00
</head>
<body>
<div id='app'>
2018-04-14 02:59:43 +00:00
<ul>
<li v-for="(ingredient, i) in ingredients" :key="ingredient">
2018-04-14 03:01:44 +00:00
({{i+1}}) {{ ingredient }}
2018-04-14 02:59:43 +00:00
</li>
</ul>
<button @click="ingredients.push('spices')"> Add New</button>
2018-04-14 03:07:37 +00:00
<hr>
2018-04-14 03:03:06 +00:00
<template v-for="(ingredient, index) in ingredients">
<h1>{{ingredient}}</h1>
<p>{{index}}</p>
</template>
2018-04-14 03:07:37 +00:00
<hr>
<ul>
<li v-for="person in persons">
<div v-for="(value, key, index) in person">
{{key}}: {{value}} - {{index}}
</div>
</li>
</ul>
2018-04-14 03:09:19 +00:00
<hr>
<span v-for="n in 10">{{n}} </span>
2018-04-14 03:07:37 +00:00
2018-04-13 14:54:53 +00:00
</div>
<script src="app.js" charset="utf-8"></script>
</body>
</html>