Vue Introduction: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 33: | Line 33: | ||
==Sections== | ==Sections== | ||
Vue files are comprised of three sections. No prizes for what each bit does | Vue files are comprised of three sections. No prizes for what each bit does | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="vue"> | ||
<template> | <template> | ||
<template/> | <template/> | ||
Line 43: | Line 43: | ||
</style> | </style> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=Displaying Data and Events= | =Displaying Data and Events= | ||
<syntaxhighlight lang="html"> | <syntaxhighlight lang="html"> | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 10:59, 9 December 2020
Intro
Hello John (No world)
Resource for the tutorial was https://github.com/johnpapa/vue-getting-started
The vue js lives at https://cdn.jsdelivr.net/npm/vue. Below is a simple example just showing two way binding
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
</head>
<body>
<div id="app">
<input type="text" v-model="name">
<p>Hello {{name}}</p>
</div>
<script>
new Vue({
el: "#app",
data() {
return {
name: "John"
}
}
})
</script>
</body>
</html>
Sections
Vue files are comprised of three sections. No prizes for what each bit does
<template>
<template/>
<script>
</script>
<style>
</style>