-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathattribute-binding.html
More file actions
49 lines (40 loc) · 1.14 KB
/
Copy pathattribute-binding.html
File metadata and controls
49 lines (40 loc) · 1.14 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="main.css" />
<script src="main.js"></script>
<style>
.is-loading{
background-color: yellowgreen;
}
</style>
</head>
<body>
<div id="root">
<button :title="title" :class="{ 'is-loading': isLoading }" @click="toggleClass">
Toggle me
</button>
<!-- OR -->
<!-- <button v-bind:title="title">Hover over me</button> -->
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
new Vue({
el : '#root',
data: {
title: "Now the title is being set with JS",
isLoading: false,
},
methods: {
toggleClass(){
this.isLoading = true;
}
},
})
</script>
</body>
</html>