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 = {
3939 var partial = this . vm . $options . partials [ id ]
4040 _ . assertAsset ( partial , 'partial' , id )
4141 if ( partial ) {
42+ var filters = this . filters && this . filters . read
43+ if ( filters ) {
44+ partial = _ . applyFilters ( partial , filters , this . vm )
45+ }
4246 this . compile ( templateParser . parse ( partial , true ) )
4347 }
4448 }
Original file line number Diff line number Diff line change @@ -111,5 +111,25 @@ if (_.inBrowser) {
111111 } )
112112 } )
113113
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+
114134 } )
115135}
You can’t perform that action at this time.
0 commit comments