File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
test/unit/specs/directives Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ module.exports = {
39
39
var partial = this . vm . $options . partials [ id ]
40
40
_ . assertAsset ( partial , 'partial' , id )
41
41
if ( partial ) {
42
+ var filters = this . filters && this . filters . read
43
+ if ( filters ) {
44
+ partial = _ . applyFilters ( partial , filters , this . vm )
45
+ }
42
46
this . compile ( templateParser . parse ( partial , true ) )
43
47
}
44
48
}
Original file line number Diff line number Diff line change @@ -111,5 +111,25 @@ if (_.inBrowser) {
111
111
} )
112
112
} )
113
113
114
+ it ( 'partial with filters' , function ( ) {
115
+ var vm = new Vue ( {
116
+ el : el ,
117
+ template : '<div>{{>test | replace}}</div>' ,
118
+ partials : {
119
+ test : '{{a}}'
120
+ } ,
121
+ data : {
122
+ a : 'A' ,
123
+ b : 'B'
124
+ } ,
125
+ filters : {
126
+ replace : function ( ) {
127
+ return '{{b}}'
128
+ }
129
+ }
130
+ } )
131
+ expect ( el . innerHTML ) . toBe ( '<div>' + wrap ( 'B' ) + '</div>' )
132
+ } )
133
+
114
134
} )
115
135
}
You can’t perform that action at this time.
0 commit comments