提交 5a913d36 编写于 作者: fxy060608's avatar fxy060608

feat(mp): remove isCustomElement

上级 a1034d51
import {isFunction, extend, isPlainObject, isPromise, isArray, hasOwn} from "@vue/shared"; import {isFunction, extend, isPlainObject, isPromise, isArray, hasOwn} from "@vue/shared";
import {injectHook, openBlock, createBlock, createVNode, Fragment, renderList, toDisplayString, createCommentVNode, createTextVNode, Transition, withCtx, withModifiers, withDirectives, vShow, resolveComponent, KeepAlive, resolveDynamicComponent, mergeProps, renderSlot} from "vue"; import {injectHook, openBlock, createBlock, createVNode, Fragment, renderList, toDisplayString, createCommentVNode, createTextVNode, Transition, withCtx, withModifiers, withDirectives, vShow, resolveComponent, KeepAlive, resolveDynamicComponent, mergeProps, renderSlot} from "vue";
import {isCustomElement, TABBAR_HEIGHT, COMPONENT_NAME_PREFIX, NAVBAR_HEIGHT} from "@dcloudio/uni-shared";
import {passiveOptions, Input} from "@dcloudio/uni-components"; import {passiveOptions, Input} from "@dcloudio/uni-components";
export * from "@dcloudio/uni-components"; export * from "@dcloudio/uni-components";
import {TABBAR_HEIGHT, COMPONENT_NAME_PREFIX, isCustomElement, NAVBAR_HEIGHT} from "@dcloudio/uni-shared";
import {createWebHistory, createWebHashHistory, createRouter} from "vue-router"; import {createWebHistory, createWebHashHistory, createRouter} from "vue-router";
function applyOptions(options, instance2, publicThis) { function applyOptions(options, instance2, publicThis) {
Object.keys(options).forEach((name) => { Object.keys(options).forEach((name) => {
...@@ -49,7 +49,6 @@ function initApp(app) { ...@@ -49,7 +49,6 @@ function initApp(app) {
if (isFunction(app._component.onError)) { if (isFunction(app._component.onError)) {
appConfig2.errorHandler = errorHandler; appConfig2.errorHandler = errorHandler;
} }
appConfig2.isCustomElement = isCustomElement;
const globalProperties = appConfig2.globalProperties; const globalProperties = appConfig2.globalProperties;
globalProperties.$hasHook = hasHook; globalProperties.$hasHook = hasHook;
globalProperties.$callHook = callHook; globalProperties.$callHook = callHook;
...@@ -1820,6 +1819,7 @@ function initSystemComponents(app2) { ...@@ -1820,6 +1819,7 @@ function initSystemComponents(app2) {
} }
var index = { var index = {
install(app) { install(app) {
app._context.config.isCustomElement = isCustomElement;
initApp(app); initApp(app);
initView(app); initView(app);
initService(app); initService(app);
......
...@@ -2,12 +2,15 @@ import { App } from 'vue' ...@@ -2,12 +2,15 @@ import { App } from 'vue'
import { initApp } from '@dcloudio/uni-vue' import { initApp } from '@dcloudio/uni-vue'
import { initView, initService } from '@dcloudio/uni-core' import { initView, initService } from '@dcloudio/uni-core'
import { isCustomElement } from '@dcloudio/uni-shared'
import { initRouter } from './router' import { initRouter } from './router'
import { initSystemComponents } from './components' import { initSystemComponents } from './components'
export default { export default {
install(app: App) { install(app: App) {
app._context.config.isCustomElement = isCustomElement
initApp(app) initApp(app)
initView(app) initView(app)
initService(app) initService(app)
......
import { isSymbol, extend, isMap, isObject, toRawType, def, isArray, isString, isFunction, isPromise, capitalize, remove, EMPTY_OBJ, NOOP, isGloballyWhitelisted, isIntegerKey, hasOwn, hasChanged, NO, invokeArrayFns, isSet, makeMap, hyphenate, isReservedProp, camelize, EMPTY_ARR, toTypeString, isOn } from '@vue/shared'; import { isSymbol, extend, isMap, isObject, toRawType, def, isArray, isString, isFunction, isPromise, capitalize, remove, EMPTY_OBJ, NOOP, isGloballyWhitelisted, isIntegerKey, hasOwn, hasChanged, NO, invokeArrayFns, isSet, makeMap, hyphenate, isReservedProp, camelize, EMPTY_ARR, toTypeString, isOn } from '@vue/shared';
export { camelize } from '@vue/shared'; export { camelize } from '@vue/shared';
import { isCustomElement } from '@dcloudio/uni-shared';
const targetMap = new WeakMap(); const targetMap = new WeakMap();
const effectStack = []; const effectStack = [];
...@@ -3537,7 +3536,6 @@ function initApp(app) { ...@@ -3537,7 +3536,6 @@ function initApp(app) {
if (isFunction(app._component.onError)) { if (isFunction(app._component.onError)) {
appConfig.errorHandler = errorHandler; appConfig.errorHandler = errorHandler;
} }
appConfig.isCustomElement = isCustomElement;
const globalProperties = appConfig.globalProperties; const globalProperties = appConfig.globalProperties;
globalProperties.$hasHook = hasHook; globalProperties.$hasHook = hasHook;
globalProperties.$callHook = callHook; globalProperties.$callHook = callHook;
......
...@@ -52,6 +52,7 @@ const TAGS = [ ...@@ -52,6 +52,7 @@ const TAGS = [
'uni-layout', 'uni-layout',
'uni-content', 'uni-content',
'uni-main', 'uni-main',
'uni-top-window',
'uni-left-window', 'uni-left-window',
'uni-right-window', 'uni-right-window',
'uni-tabbar', 'uni-tabbar',
......
...@@ -3,6 +3,7 @@ export const TAGS = [ ...@@ -3,6 +3,7 @@ export const TAGS = [
'uni-layout', 'uni-layout',
'uni-content', 'uni-content',
'uni-main', 'uni-main',
'uni-top-window',
'uni-left-window', 'uni-left-window',
'uni-right-window', 'uni-right-window',
'uni-tabbar', 'uni-tabbar',
......
import { ComponentPublicInstance } from '@vue/runtime-core' import { ComponentPublicInstance } from '@vue/runtime-core'
export { isCustomElement } from '@dcloudio/uni-shared'
export function errorHandler( export function errorHandler(
err: unknown, err: unknown,
instance: ComponentPublicInstance | null, instance: ComponentPublicInstance | null,
......
...@@ -4,14 +4,13 @@ import { isFunction } from '@vue/shared' ...@@ -4,14 +4,13 @@ import { isFunction } from '@vue/shared'
import { applyOptions } from './componentOptions' import { applyOptions } from './componentOptions'
import { set, hasHook, callHook } from './componentInstance' import { set, hasHook, callHook } from './componentInstance'
import { errorHandler, isCustomElement } from './appConfig' import { errorHandler } from './appConfig'
export function initApp(app: App) { export function initApp(app: App) {
const appConfig = app._context.config const appConfig = app._context.config
if (isFunction((app._component as any).onError)) { if (isFunction((app._component as any).onError)) {
appConfig.errorHandler = errorHandler appConfig.errorHandler = errorHandler
} }
appConfig.isCustomElement = isCustomElement
const globalProperties = appConfig.globalProperties const globalProperties = appConfig.globalProperties
globalProperties.$hasHook = hasHook globalProperties.$hasHook = hasHook
globalProperties.$callHook = callHook globalProperties.$callHook = callHook
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册