Skip to content

Commit a004e30

Browse files
egoistyyx990803
authored andcommitted
feat: inject issuerPath to resourceQuery for custom block src imports (#1313)
1 parent 82ba121 commit a004e30

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: lib/codegen/customBlocks.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ module.exports = function genCustomBlocksCode (
99
return `\n/* custom blocks */\n` + blocks.map((block, i) => {
1010
const src = block.attrs.src || resourcePath
1111
const attrsQuery = attrsToQuery(block.attrs)
12-
const query = `?vue&type=custom&index=${i}&blockType=${qs.escape(block.type)}${attrsQuery}`
12+
const issuerQuery = block.attrs.src ? `&issuerPath=${qs.escape(resourcePath)}` : ''
13+
const query = `?vue&type=custom&index=${i}&blockType=${qs.escape(block.type)}${issuerQuery}${attrsQuery}`
1314
return (
1415
`import block${i} from ${stringifyRequest(src + query)}\n` +
1516
`if (typeof block${i} === 'function') block${i}(component)`

0 commit comments

Comments
 (0)