File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 3
3
<h1 >All Blog Articles</h1 >
4
4
<input type =" text" v-model =" search" placeholder =" search blogs" />
5
5
<div v-for =" blog in filteredBlogs" class =" single-blog" >
6
- <h2 >{{ blog.title | to-uppercase }}</h2 >
6
+ <h2 v-rainbow >{{ blog.title | toUppercase }}</h2 >
7
7
<article >{{ blog.body }}</article >
8
8
</div >
9
9
</div >
@@ -31,6 +31,21 @@ export default {
31
31
return blog .title .match (this .search );
32
32
});
33
33
}
34
+ },
35
+ filters: {
36
+ /* 'to-uppercase': function(value){
37
+ return value.toUpperCase();
38
+ }*/
39
+ toUppercase (value ){
40
+ return value .toUpperCase ();
41
+ }
42
+ },
43
+ directives: {
44
+ ' rainbow' : {
45
+ bind (el , binding , vnode ){
46
+ el .style .color = " #" + Math .random ().toString (16 ).slice (2 , 8 );
47
+ }
48
+ }
34
49
}
35
50
}
36
51
</script >
Original file line number Diff line number Diff line change @@ -6,9 +6,10 @@ import App from './App.vue'
6
6
Vue . use ( VueResource ) ;
7
7
8
8
// Filters
9
+ /*
9
10
Vue.filter('to-uppercase', function(value){
10
11
return value.toUpperCase();
11
- } ) ;
12
+ }); */
12
13
13
14
new Vue ( {
14
15
el : '#app' ,
You can’t perform that action at this time.
0 commit comments