What problem does this feature solve?
componentName("/order/Index.vue")="Order"
What does the proposed API look like?
- 检查所有用到正则
/([^/\\]+)\.\w+$/的代码
- (正确)获取componentName的部分代码
const match = Component.__file.match(/([/\\](\w+))?([/\\](\w+))\.\w+$/)
if (match) {
if (capitalize(match[4]) === "Index") {
const dirName = match[2]
name = capitalize(dirName)
} else {
name = match[4]
}
}
What problem does this feature solve?
componentName("/order/Index.vue")="Order"
What does the proposed API look like?
/([^/\\]+)\.\w+$/的代码