File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -48,17 +48,19 @@ module.exports = {
4848 _ . assertAsset ( partial , 'partial' , id )
4949 if ( partial ) {
5050 var frag = templateParser . parse ( partial , true )
51- var linker = this . compile ( frag , partial )
51+ // cache partials based on constructor id.
52+ var cacheId = ( this . vm . constructor . cid || '' ) + partial
53+ var linker = this . compile ( frag , cacheId )
5254 // this is provided by v-if
5355 this . link ( frag , linker )
5456 }
5557 } ,
5658
57- compile : function ( frag , partial ) {
58- var hit = cache . get ( partial )
59+ compile : function ( frag , cacheId ) {
60+ var hit = cache . get ( cacheId )
5961 if ( hit ) return hit
6062 var linker = compiler . compile ( frag , this . vm . $options , true )
61- cache . put ( partial , linker )
63+ cache . put ( cacheId , linker )
6264 return linker
6365 } ,
6466
You can’t perform that action at this time.
0 commit comments