-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkasus1.html
55 lines (54 loc) · 1.57 KB
/
kasus1.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Kasus 1</title>
</head>
<body>
<div id="app">
<!-- filters -->
<h1>Filters: {{ message | upper }}</h1>
<h1>methods: {{ upper(message) }}</h1>
<h1>Computed: {{ messageUpperCase }}</h1>
<h1>{{ price | formatCurency('USD') }}</h1>
<h1>{{ price | formatCurency('IDR') }}</h1>
</div>
<script src="lib/vue.js"></script>
<script>
var vm = new Vue({
el: '#app',
data: {
message: 'Hello World',
price: 5000
},
// filters: {
// upper (text){
// return text.toUpperCase()
// }
// },
methods: {
upper(text){
return text.toUpperCase()
}
},
computed: {
messageUpperCase(){
return this.message.toUpperCase()
}
},
filters: {
formatCurency (value, currency){
var formatter = new Intl.NumberFormat('id-ID',{
style: 'currency',
currency: currency,
minimumFractionDigits: 2,
});
return formatter.format(value)
}
}
});
</script>
</body>
</html>