Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dec5 #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,29 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body></body>
<body>
<div id="app">
<p>{{ message}}</p>
<ul>
<li v-for="character in listOfCharacters">{{character}}</li>
</ul>
</div>

<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script>
const { createApp } = Vue

const app = createApp({
data() {
return {
message:"Super Mario Bros",
listOfCharacters: ["Mario", "Luigi", "Bowser", "Toad"]

}
}
})
app.mount('#app')
</script>

</body>
</html>
46 changes: 45 additions & 1 deletion playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,49 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Playground — Complete Intro to Vue 3</title>
</head>
<body></body>
<body>
<h1>Hello Frontend Masters</h1>
<div id="app">
<hr/>
<h1>Counter</h1>
<p>{{count}}</p>
<button @click="incrementCount">Increment Count</button>
<div>
<label for="incrementAmount">Increment Count</label>
<input type="number" v-model="incrementAmount"/>
</div>

<hr/>
<p v-if="message.length % 2 === 0">Even: {{message.toUpperCase()}}</p>
<p v-else>Odd: {{message}}</p>
<ul>
<li v-for="number in listofNumbers">{{number}}</li>
</ul>

</div>

<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script>
const {createApp} = Vue;

const app = createApp({
data() {
return {
count:10,
incrementAmount: 8,
message: 'Hello it works',
listofNumbers: [1,2,3,4,5]
}
},
methods:{
incrementCount(){
this.count += this.incrementAmount
}
}

})

app.mount('#app')
</script>
</body>
</html>