wip: compat configuration
This commit is contained in:
@@ -7,7 +7,7 @@ import {
|
||||
RenderFunction,
|
||||
warn,
|
||||
createApp,
|
||||
createCompatVue
|
||||
compatUtils
|
||||
} from '@vue/runtime-dom'
|
||||
import { isString, NOOP, generateCodeFrame, extend } from '@vue/shared'
|
||||
import { InternalRenderFunction } from 'packages/runtime-core/src/component'
|
||||
@@ -92,9 +92,10 @@ function compileToFunction(
|
||||
|
||||
registerRuntimeCompiler(compileToFunction)
|
||||
|
||||
const Vue = createCompatVue(createApp)
|
||||
const Vue = compatUtils.createCompatVue(createApp)
|
||||
|
||||
Vue.compile = compileToFunction
|
||||
|
||||
extend(Vue, runtimeDom)
|
||||
|
||||
export default Vue
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
// This entry exports the runtime only, and is built as
|
||||
// `dist/vue.esm-bundler.js` which is used by default for bundlers.
|
||||
import { initDev } from './dev'
|
||||
import { warn } from '@vue/runtime-dom'
|
||||
import { compatUtils, createApp, warn } from '@vue/runtime-dom'
|
||||
import { extend } from '@vue/shared'
|
||||
|
||||
if (__DEV__) {
|
||||
initDev()
|
||||
}
|
||||
|
||||
export * from '@vue/runtime-dom'
|
||||
import * as runtimeDom from '@vue/runtime-dom'
|
||||
|
||||
export const compile = () => {
|
||||
const Vue = compatUtils.createCompatVue(createApp)
|
||||
|
||||
Vue.compile = (() => {
|
||||
if (__DEV__) {
|
||||
warn(
|
||||
`Runtime compilation is not supported in this build of Vue.` +
|
||||
@@ -22,4 +25,8 @@ export const compile = () => {
|
||||
: ``) /* should not happen */
|
||||
)
|
||||
}
|
||||
}
|
||||
}) as any
|
||||
|
||||
extend(Vue, runtimeDom)
|
||||
|
||||
export default Vue
|
||||
|
||||
Reference in New Issue
Block a user