diff --git a/src/core/component/const/index.ts b/src/core/component/const/index.ts index 59a7d5b1be..0d84d07731 100644 --- a/src/core/component/const/index.ts +++ b/src/core/component/const/index.ts @@ -15,3 +15,4 @@ export * from 'core/component/const/cache'; export * from 'core/component/const/symbols'; export * from 'core/component/const/enums'; export * from 'core/component/const/validators'; +export * from 'core/component/const/wc-validators'; diff --git a/src/core/component/const/validators.ts b/src/core/component/const/validators.ts index 5ac34accfd..04456480c8 100644 --- a/src/core/component/const/validators.ts +++ b/src/core/component/const/validators.ts @@ -6,6 +6,8 @@ * https://github.com/V4Fire/Client/blob/master/LICENSE */ +import { isV4WebComponent } from 'core/component/const/wc-validators'; + const componentPrefixes = new Set([ 'b-', 'g-', @@ -28,6 +30,6 @@ export const isComponent = { return false; } - return componentPrefixes.has(name.slice(0, 2)) && !name.includes(' ', 2); + return !isV4WebComponent.test(name) && componentPrefixes.has(name.slice(0, 2)) && !name.includes(' ', 2); } }; diff --git a/src/core/component/const/wc-validators.ts b/src/core/component/const/wc-validators.ts new file mode 100644 index 0000000000..62b3f2e321 --- /dev/null +++ b/src/core/component/const/wc-validators.ts @@ -0,0 +1,16 @@ +/*! + * V4Fire Client Core + * https://github.com/V4Fire/Client + * + * Released under the MIT license + * https://github.com/V4Fire/Client/blob/master/LICENSE + */ + +/** + * A RegExp to check if the given string is the name of a web-component + */ +export const isV4WebComponent = { + test(_name: Nullable): boolean { + return false; + } +}; diff --git a/src/core/component/index.ts b/src/core/component/index.ts index dc5244087a..754fc7e898 100644 --- a/src/core/component/index.ts +++ b/src/core/component/index.ts @@ -30,6 +30,7 @@ export { app, isComponent, + isV4WebComponent, rootComponents, beforeHooks,