wip: fix root data option compat
This commit is contained in:
parent
3d810eb422
commit
926e12862b
@ -93,6 +93,12 @@ export function createCompatVue(
|
|||||||
const singletonApp = createApp({})
|
const singletonApp = createApp({})
|
||||||
|
|
||||||
function createCompatApp(options: ComponentOptions = {}, Ctor: any) {
|
function createCompatApp(options: ComponentOptions = {}, Ctor: any) {
|
||||||
|
const { data } = options
|
||||||
|
if (data && !isFunction(data)) {
|
||||||
|
__DEV__ && warnDeprecation(DeprecationTypes.OPTIONS_DATA_FN)
|
||||||
|
options.data = () => data
|
||||||
|
}
|
||||||
|
|
||||||
const app = createApp(options)
|
const app = createApp(options)
|
||||||
|
|
||||||
// copy over asset registries and deopt flag
|
// copy over asset registries and deopt flag
|
||||||
@ -142,14 +148,9 @@ export function createCompatVue(
|
|||||||
if (!inlineOptions) {
|
if (!inlineOptions) {
|
||||||
return createCompatApp(options, SubVue)
|
return createCompatApp(options, SubVue)
|
||||||
} else {
|
} else {
|
||||||
const { el, data } = inlineOptions
|
|
||||||
if (data && !isFunction(data)) {
|
|
||||||
__DEV__ && warnDeprecation(DeprecationTypes.OPTIONS_DATA_FN)
|
|
||||||
inlineOptions.data = () => data
|
|
||||||
}
|
|
||||||
return createCompatApp(
|
return createCompatApp(
|
||||||
{
|
{
|
||||||
el,
|
el: inlineOptions.el,
|
||||||
extends: options,
|
extends: options,
|
||||||
mixins: [inlineOptions]
|
mixins: [inlineOptions]
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user