Vue.js hello world
Created
August 25, 2020 14:44
-
-
Save alrayyes/96059422431e993c77b308031cb532ae to your computer and use it in GitHub Desktop.
Hello World
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
<!-- Use preprocessors via the lang attribute! e.g. <template lang="pug"> --> | |
<template> | |
<div id="app"> | |
<h1>{{message}}</h1> | |
<p> | |
Learn more with the | |
<a | |
href="https://vuejs.org/" | |
target="_blank" | |
rel="noopener" | |
>Vue Docs & Resources</a>. | |
</p> | |
<button @click="doSomething">Say hello.</button> | |
</div> | |
</template> | |
<script> | |
export default { | |
data() { | |
return { | |
message: 'Welcome to Vue!' | |
}; | |
}, | |
methods: { | |
doSomething() { | |
alert('Hello!'); | |
} | |
} | |
}; | |
</script> | |
<!-- Use preprocessors via the lang attribute! e.g. <style lang="scss"> --> | |
<style> | |
#app { | |
font-family: Avenir, Helvetica, Arial, sans-serif; | |
text-align: center; | |
color: #2c3e50; | |
margin-top: 60px; | |
} | |
a, | |
button { | |
color: #4fc08d; | |
} | |
button { | |
background: none; | |
border: solid 1px; | |
border-radius: 2em; | |
font: inherit; | |
padding: 0.75em 2em; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment