File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
test/unit/features/global-api Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -66,10 +66,13 @@ export function resolveConstructorOptions (Ctor: Class<Component>) {
6666 if ( Ctor . super ) {
6767 const superOptions = Ctor . super . options
6868 const cachedSuperOptions = Ctor . superOptions
69+ const extendOptions = Ctor . extendOptions
6970 if ( superOptions !== cachedSuperOptions ) {
7071 // super option changed
7172 Ctor . superOptions = superOptions
72- options = Ctor . options = mergeOptions ( superOptions , Ctor . extendOptions )
73+ extendOptions . render = options . render
74+ extendOptions . staticRenderFns = options . staticRenderFns
75+ options = Ctor . options = mergeOptions ( superOptions , extendOptions )
7376 if ( options . name ) {
7477 options . components [ options . name ] = Ctor
7578 }
Original file line number Diff line number Diff line change @@ -56,4 +56,18 @@ describe('Global API: mixin', () => {
5656
5757 expect ( vm . $el . textContent ) . toBe ( 'hi' )
5858 } )
59+
60+ // vue-loader#433
61+ it ( 'should not drop late-set render functions' , ( ) => {
62+ const Test = Vue . extend ( { } )
63+ Test . options . render = h => h ( 'div' , 'hello' )
64+
65+ Vue . mixin ( { } )
66+
67+ const vm = new Vue ( {
68+ render : h => h ( Test )
69+ } ) . $mount ( )
70+
71+ expect ( vm . $el . textContent ) . toBe ( 'hello' )
72+ } )
5973} )
You can’t perform that action at this time.
0 commit comments