feat: add isCustomElement option (#299)
This commit is contained in:
@@ -28,6 +28,7 @@ export interface AppConfig {
|
||||
devtools: boolean
|
||||
performance: boolean
|
||||
readonly isNativeTag?: (tag: string) => boolean
|
||||
isCustomElement?: (tag: string) => boolean
|
||||
errorHandler?: (
|
||||
err: Error,
|
||||
instance: ComponentPublicInstance | null,
|
||||
@@ -62,6 +63,7 @@ export function createAppContext(): AppContext {
|
||||
devtools: true,
|
||||
performance: false,
|
||||
isNativeTag: NO,
|
||||
isCustomElement: NO,
|
||||
errorHandler: undefined,
|
||||
warnHandler: undefined
|
||||
},
|
||||
|
||||
@@ -350,6 +350,7 @@ function finishComponentSetup(
|
||||
if (__RUNTIME_COMPILE__ && Component.template && !Component.render) {
|
||||
if (compile) {
|
||||
Component.render = compile(Component.template, {
|
||||
isCustomElement: instance.appContext.config.isCustomElement || NO,
|
||||
onError(err: CompilerError) {
|
||||
if (__DEV__) {
|
||||
const message = `Template compilation error: ${err.message}`
|
||||
|
||||
Reference in New Issue
Block a user