Skip to content

Instantly share code, notes, and snippets.

@chitoku-k
Last active May 2, 2017 17:36
Show Gist options
  • Save chitoku-k/bfc345306b77309f54a2a8811693957f to your computer and use it in GitHub Desktop.
Save chitoku-k/bfc345306b77309f54a2a8811693957f to your computer and use it in GitHub Desktop.
babel-standalone
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div id="app" style="display: none" :style="{ display: 'block' }">
<input type="button" value="ホモを出す" v-on:click="activate">
<ul>
<li v-for="(value, key) of list">{{ key }} は{{ value ? 'ホモ' : 'ノンケ' }}だよ</li>
</ul>
</div>
<script src="https://unpkg.com/[email protected]"></script>
<script src="https://unpkg.com/babel-polyfill@6/dist/polyfill.min.js"></script>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<script type="text/babel">
const app = new Vue({
el: "#app",
data: {
homo: {
mpyw: true,
ritsuko: true,
gao: false,
},
list: {},
},
methods: {
activate() {
for (const [ key, value ] of Object.entries(this.homo)) {
this.$set(this.list, key, value);
}
},
},
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment