From 7b215b81f2ab1b5509530f1a1be4c2b41929b19d Mon Sep 17 00:00:00 2001 From: qiang Date: Fri, 19 Apr 2024 15:35:08 +0800 Subject: [PATCH] fix: options with mp --- packages/uni-template-compiler/lib/auto-components.js | 2 +- packages/uni-template-compiler/lib/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/uni-template-compiler/lib/auto-components.js b/packages/uni-template-compiler/lib/auto-components.js index c0e2b099d..464cd0c50 100644 --- a/packages/uni-template-compiler/lib/auto-components.js +++ b/packages/uni-template-compiler/lib/auto-components.js @@ -111,7 +111,7 @@ const compilerModule = { if (process.env.UNI_PLATFORM === 'quickapp-native') { // 排查所有标签 (options.isUnaryTag.autoComponents || (options.isUnaryTag.autoComponents = new Set())).add(el.tag) - } else if (isComponent(el.tag, options.mp.platform) && el.tag !== 'App') { // App.vue + } else if (isComponent(el.tag, options.mp && options.mp.platform) && el.tag !== 'App') { // App.vue // 挂在 isUnaryTag 上边,可以保证外部访问到 (options.isUnaryTag.autoComponents || (options.isUnaryTag.autoComponents = new Set())).add(el.tag) } diff --git a/packages/uni-template-compiler/lib/index.js b/packages/uni-template-compiler/lib/index.js index 79bca208d..73046f331 100644 --- a/packages/uni-template-compiler/lib/index.js +++ b/packages/uni-template-compiler/lib/index.js @@ -67,7 +67,7 @@ module.exports = { options.optimize = false // 启用 staticRenderFns // domProps => attrs options.mustUseProp = () => false - options.isReservedTag = (tagName) => !isComponent(tagName, options.mp.platform) // 非组件均为内置 + options.isReservedTag = (tagName) => !isComponent(tagName, options.mp && options.mp.platform) // 非组件均为内置 options.getTagNamespace = () => false try { -- GitLab