Skip to content

Commit

Permalink
feat: inject issuerPath to resourceQuery for custom block src imports (
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist authored and yyx990803 committed May 28, 2018
1 parent 82ba121 commit a004e30
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/codegen/customBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ module.exports = function genCustomBlocksCode (
return `\n/* custom blocks */\n` + blocks.map((block, i) => {
const src = block.attrs.src || resourcePath
const attrsQuery = attrsToQuery(block.attrs)
const query = `?vue&type=custom&index=${i}&blockType=${qs.escape(block.type)}${attrsQuery}`
const issuerQuery = block.attrs.src ? `&issuerPath=${qs.escape(resourcePath)}` : ''
const query = `?vue&type=custom&index=${i}&blockType=${qs.escape(block.type)}${issuerQuery}${attrsQuery}`
return (
`import block${i} from ${stringifyRequest(src + query)}\n` +
`if (typeof block${i} === 'function') block${i}(component)`
Expand Down

0 comments on commit a004e30

Please sign in to comment.