-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVueTemplate.html
76 lines (66 loc) · 1.82 KB
/
VueTemplate.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Vue Template</title>
<link rel="icon" type="image/png" href="Icon.png" />
<!-- CDN: -->
<script src="https://unpkg.com/[email protected]/dist/vue.global.js"></script>
<!--
OTHER CDN:
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.global.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.global.prod.min.js"></script>
SELF HOSTED: (works offline)
<script src="./libs/vue.v3.3.4.global.prod.min.js"></script>
DOCUMENTATION:
https://vuejs.org/guide/quick-start.html#using-vue-from-cdn
https://vuejs.org/guide/essentials/application.html
https://vuejs.org/guide/quick-start.html#using-vue-from-cdn
https://www.jsdelivr.com/package/npm/vue
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
-->
</head>
<body>
<h4>Vue Template</h4>
<div id="vue-root">
<div>Name: <input v-model="name"></div>
<div>Surname: <input v-model="surname"></div>
<button @click="sayHello">Say Hello</button>
<button @click="count++">Counter: {{ count }}</button>
</div>
</body>
<script type="importmap">
{
"imports": {
"vue": "https://unpkg.com/[email protected]/dist/vue.esm-browser.js"
}
}
</script>
<script type="module">
//import * as Vue from 'https://unpkg.com/[email protected]/dist/vue.esm-browser.js' // Without requiring the "importamp".
//import * as Vue from 'https://cdn.jsdelivr.net/npm/[email protected]/+esm' // Another CDN option.
//import * as Vue from 'vue' // Thanks to the "importamp".
var App = {
name: 'App',
data() {
return {
count: 0,
name: 'Peter',
surname: 'Parker',
}
},
computed: {
fullName() {
return `${this.name} ${this.surname}`
}
},
methods: {
sayHello() {
alert(`Hello ${this.fullName}!`)
}
}
}
var vueApp = Vue.createApp(App).mount('#vue-root')
console.log("Finished!")
</script>
</html>