Skip to content

Commit

Permalink
feat: custom blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Dec 24, 2020
1 parent 71aff6e commit 03f24f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/plugin-vue/src/index.ts
Expand Up @@ -131,7 +131,7 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
block = descriptor.template!
} else if (query.type === 'style') {
block = descriptor.styles[query.index!]
} else if (query.index) {
} else if (query.index != null) {
block = descriptor.customBlocks[query.index]
}
if (block) {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-vue/src/utils/query.ts
Expand Up @@ -14,7 +14,7 @@ export function parseVueRequest(id: string) {
if (query.vue != null) {
query.vue = true
}
if (query.index) {
if (query.index != null) {
query.index = Number(query.index)
}
return {
Expand Down

0 comments on commit 03f24f2

Please sign in to comment.