diff --git a/packages/vant-markdown-loader/src/index.js b/packages/vant-markdown-loader/src/index.js index f2a5fa252..ece432bcf 100644 --- a/packages/vant-markdown-loader/src/index.js +++ b/packages/vant-markdown-loader/src/index.js @@ -8,7 +8,7 @@ const extractDemo = require('./extract-demo'); const sideEffectTags = require('./side-effect-tags'); function camelize(str) { - return str.replace(/-(\w)/g, (_, c) => (c ? c.toUpperCase() : '')); + return `-${str}`.replace(/-(\w)/g, (_, c) => (c ? c.toUpperCase() : '')); } const sharedVueOptions = `mounted() {