Created
April 2, 2019 15:35
-
-
Save siberiy4/2694c3dfb8457abca82aad31ef47594b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<title>Document</title> | |
</head> | |
<body> | |
<div id="root"> | |
<task-list></task-list> | |
</div> | |
</body> | |
<script> | |
Vue.component("task-list", { | |
template: ` | |
<div> | |
<task v-for="task in tasks">{{task.task}}</task> | |
</div> | |
`, | |
data() { | |
return { | |
tasks: [ | |
{ task: "A", complete: true }, | |
{ task: "B", complete: false }, | |
{ task: "C", complete: true } | |
] | |
}; | |
} | |
}); | |
Vue.component("task", { | |
template: "<li><slot></slot></li>" | |
}); | |
new Vue({ | |
el: "#root" | |
}); | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment