提交 e7902890 编写于 作者: Q qiang

fix(mp-alipay): styleIsolation: 'apply-shared'

上级 8622d731
...@@ -78,8 +78,10 @@ const supportGlobalUsingComponents = process.env.UNI_PLATFORM === 'mp-weixin' || ...@@ -78,8 +78,10 @@ const supportGlobalUsingComponents = process.env.UNI_PLATFORM === 'mp-weixin' ||
function updateComponentJson (name, jsonObj, usingComponents = true, type = 'Component') { function updateComponentJson (name, jsonObj, usingComponents = true, type = 'Component') {
if (type === 'Component') { if (type === 'Component') {
jsonObj.component = true jsonObj.component = true
} if (process.env.UNI_PLATFORM === 'mp-alipay') {
if (type === 'Page') { jsonObj.styleIsolation = 'apply-shared'
}
} else if (type === 'Page') {
if (process.env.UNI_PLATFORM === 'mp-baidu') { if (process.env.UNI_PLATFORM === 'mp-baidu') {
jsonObj.component = true jsonObj.component = true
} }
...@@ -162,6 +164,9 @@ function updateUsingComponents (name, usingComponents, type) { ...@@ -162,6 +164,9 @@ function updateUsingComponents (name, usingComponents, type) {
const jsonObj = JSON.parse(oldJsonStr) const jsonObj = JSON.parse(oldJsonStr)
if (type === 'Component') { if (type === 'Component') {
jsonObj.component = true jsonObj.component = true
if (process.env.UNI_PLATFORM === 'mp-alipay') {
jsonObj.styleIsolation = 'apply-shared'
}
} else if (type === 'Page') { } else if (type === 'Page') {
if (process.env.UNI_PLATFORM === 'mp-baidu') { if (process.env.UNI_PLATFORM === 'mp-baidu') {
jsonObj.component = true jsonObj.component = true
...@@ -179,6 +184,9 @@ function updateUsingComponents (name, usingComponents, type) { ...@@ -179,6 +184,9 @@ function updateUsingComponents (name, usingComponents, type) {
} }
if (type === 'Component') { if (type === 'Component') {
jsonObj.component = true jsonObj.component = true
if (process.env.UNI_PLATFORM === 'mp-alipay') {
jsonObj.styleIsolation = 'apply-shared'
}
} else if (type === 'Page') { } else if (type === 'Page') {
if (process.env.UNI_PLATFORM === 'mp-baidu') { if (process.env.UNI_PLATFORM === 'mp-baidu') {
jsonObj.component = true jsonObj.component = true
...@@ -322,7 +330,7 @@ module.exports = { ...@@ -322,7 +330,7 @@ module.exports = {
if (!fs.existsSync(filepath)) { if (!fs.existsSync(filepath)) {
try { try {
clearCache() clearCache()
} catch (e) {} } catch (e) { }
return return
} }
const pagesJsonPath = path.resolve(process.env.UNI_INPUT_DIR, 'pages.json') const pagesJsonPath = path.resolve(process.env.UNI_INPUT_DIR, 'pages.json')
...@@ -331,7 +339,7 @@ module.exports = { ...@@ -331,7 +339,7 @@ module.exports = {
if (jsonCache.mtimeMs !== mtimeMs) { if (jsonCache.mtimeMs !== mtimeMs) {
try { try {
clearCache() clearCache()
} catch (e) {} } catch (e) { }
return return
} }
jsonFileMap = new Map(jsonCache.files) jsonFileMap = new Map(jsonCache.files)
...@@ -366,4 +374,4 @@ module.exports = { ...@@ -366,4 +374,4 @@ module.exports = {
getChangedJsonFileMap, getChangedJsonFileMap,
getSpecialMethods, getSpecialMethods,
supportGlobalUsingComponents supportGlobalUsingComponents
} }
...@@ -23,6 +23,7 @@ export default function parseBaseComponent (vueComponentOptions, { ...@@ -23,6 +23,7 @@ export default function parseBaseComponent (vueComponentOptions, {
const options = { const options = {
multipleSlots: true, multipleSlots: true,
// styleIsolation: 'apply-shared',
addGlobalClass: true, addGlobalClass: true,
...(vueOptions.options || {}) ...(vueOptions.options || {})
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册