Skip to content

Instantly share code, notes, and snippets.

@earth774
Last active March 18, 2019 12:36
Show Gist options
  • Save earth774/f1ffda6887ce20432a6f1dd22167d7cd to your computer and use it in GitHub Desktop.
Save earth774/f1ffda6887ce20432a6f1dd22167d7cd to your computer and use it in GitHub Desktop.
component single element
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Amiearth</title>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="shop">
<food-app></food-app>
</div>
<template id="foodarea">
<div id="food">
<h4>เมนูอาหาร</h4>
<h6>อาหารชื่อดังเมืองไทย</h6>
</div>
</template>
<script>
var food = {
template: '#foodarea'
}
new Vue({
el: '#shop',
components: {
foodApp: food
}
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment