提交 a3b30595 编写于 作者: Q qiang

fix: 修复 Windows 上头条小程序作用域插槽(解构插槽)不显示的问题

上级 081df661
......@@ -133,7 +133,7 @@ module.exports = function generateComponent (compilation) {
origSource = origSource.trim ? origSource.trim() : ''
const result = origSource.match(/^@import ["'](.+?)["']$/)
if (result) {
const stylePath = path.join(path.dirname(name), result[1])
const stylePath = normalizePath(path.join(path.dirname(name), result[1]))
if (Object.keys(assets).includes(stylePath)) {
styleImports[stylePath] = styleImports[stylePath] || []
styleImports[stylePath].push(name)
......@@ -155,7 +155,7 @@ module.exports = function generateComponent (compilation) {
if (json) {
const data = JSON.parse(json)
const usingComponents = data.usingComponents || {}
const componentPath = path.relative('/', usingComponents[parentName])
const componentPath = normalizePath(path.relative('/', usingComponents[parentName]))
const slots = fixSlots[componentPath] = fixSlots[componentPath] || {}
const slot = slots[slotName] = slots[slotName] || {}
slot[componentName] = '/' + name.replace(fixExtname, '')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册