提交 4886bb40 编写于 作者: fxy060608's avatar fxy060608

fix(h5): vue and nvue page exist at the same time (question/144687)

上级 4e155841
......@@ -197,14 +197,29 @@ function normalizePageStyle(
pageStyle: UniApp.PagesJsonPageStyle | undefined,
platform: UniApp.PLATFORM
) {
const isNVue =
const hasNVue =
pagePath &&
process.env.UNI_INPUT_DIR &&
process.env.UNI_NVUE_COMPILER !== 'vue' &&
fs.existsSync(path.join(process.env.UNI_INPUT_DIR, pagePath + '.nvue'))
? true
: undefined
let isNVue = false
if (hasNVue) {
const hasVue = fs.existsSync(
path.join(process.env.UNI_INPUT_DIR, pagePath + '.vue')
)
if (hasVue) {
if (platform === 'app') {
if (process.env.UNI_NVUE_COMPILER !== 'vue') {
isNVue = true
}
}
} else {
isNVue = true
}
}
if (pageStyle) {
if (platform === 'h5') {
extend(pageStyle, pageStyle['app'] || pageStyle['app-plus'])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册