Last active
June 19, 2019 18:09
-
-
Save johanvergeer/f18b4f9e9785496326c082b78c76ef23 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Create a component, which is global and can be used anywhere | |
// in the application | |
const Hello = Vue.component( | |
'Hello', // Name of the component | |
{ templdate: '<span>Hello</span>' } // Options object, which contains a template | |
) | |
new Vue({ | |
template: '<div><Hello/> there</div>', // Hardcoded 'Hello' is replated with the component | |
el: '#app' | |
}); |
This file contains hidden or 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
new Vue({ | |
template: '<div>Hello there</div>', | |
el: '#app' | |
}); |
This file contains hidden or 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
// This is where the html template for the component is defined | |
// Requireda | |
<template> | |
<span class="hello">Hello there</span> | |
</template> | |
// This is where the Javascript for the component is defined | |
// Required | |
<script> | |
export default { name: 'Hello' } | |
</script> | |
// This is where the css classes fot the component are defined | |
// Optional | |
<style> | |
.hello { | |
color: white; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment