Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/core/instance/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export function resolveConstructorOptions (Ctor: Class<Component>) {
Ctor.superOptions = superOptions
extendOptions.render = options.render
extendOptions.staticRenderFns = options.staticRenderFns
extendOptions._scopeId = options._scopeId
options = Ctor.options = mergeOptions(superOptions, extendOptions)
if (options.name) {
options.components[options.name] = Ctor
Expand Down
14 changes: 14 additions & 0 deletions test/unit/features/global-api/mixin.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,18 @@ describe('Global API: mixin', () => {

expect(vm.$el.textContent).toBe('hello')
})

// #4266
it('should not drop scopedId', () => {
const Test = Vue.extend({})
Test.options._scopeId = 'foo'

Vue.mixin({})

const vm = new Test({
template: '<div><p>hi<p></div>'
}).$mount()

expect(vm.$el.children[0].hasAttribute('foo')).toBe(true)
})
})