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 = {
48
48
_ . assertAsset ( partial , 'partial' , id )
49
49
if ( partial ) {
50
50
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 )
52
54
// this is provided by v-if
53
55
this . link ( frag , linker )
54
56
}
55
57
} ,
56
58
57
- compile : function ( frag , partial ) {
58
- var hit = cache . get ( partial )
59
+ compile : function ( frag , cacheId ) {
60
+ var hit = cache . get ( cacheId )
59
61
if ( hit ) return hit
60
62
var linker = compiler . compile ( frag , this . vm . $options , true )
61
- cache . put ( partial , linker )
63
+ cache . put ( cacheId , linker )
62
64
return linker
63
65
} ,
64
66
You can’t perform that action at this time.
0 commit comments