Skip to content

Commit ca74c57

Browse files
committed
create v-purple
0 parents commit ca74c57

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

index.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Custom Directives</title>
5+
<script src="https://unpkg.com/vue"></script>
6+
</head>
7+
<body>
8+
<div id="app">
9+
<h1 v-purple>Vue School</h1>
10+
</div>
11+
12+
<script type="text/javascript">
13+
Vue.directive('purple', function (el) {
14+
el.style.color = 'purple'
15+
})
16+
17+
new Vue({
18+
el: "#app",
19+
data: {}
20+
})
21+
</script>
22+
</body>
23+
</html>

0 commit comments

Comments
 (0)