Skip to content

Commit bacad79

Browse files
committed
refactor: show error if capture is null
1 parent b583d2a commit bacad79

File tree

1 file changed

+15
-8
lines changed
  • packages/docs/.vuepress/theme-coreui/src/client/components

1 file changed

+15
-8
lines changed

packages/docs/.vuepress/theme-coreui/src/client/components/ScssDocs.vue

+15-8
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@ export default defineComponent({
1515
file: String,
1616
},
1717
setup(props) {
18-
1918
if (typeof window !== 'undefined') {
20-
window.Prism = window.Prism || {};
21-
window.Prism.manual = true;
19+
window.Prism = window.Prism || {}
20+
window.Prism.manual = true
2221
}
2322
24-
const files = import.meta.glob(`../../../../../../../node_modules/@coreui/coreui/scss/**/*.scss`, {
25-
as: 'raw',
26-
eager: true,
27-
})
23+
const files = import.meta.glob(
24+
`../../../../../../../node_modules/@coreui/coreui/scss/**/*.scss`,
25+
{
26+
as: 'raw',
27+
eager: true,
28+
},
29+
)
2830
const file = files[`../../../../../../../node_modules/@coreui/coreui/scss/${props.file}`]
2931
3032
const captureStart = `// scss-docs-start ${props.capture}`
@@ -40,8 +42,13 @@ export default defineComponent({
4042
.replaceAll('\n @', '\n@'),
4143
Prism.languages.scss,
4244
'scss',
43-
)
45+
)
4446
: null
47+
48+
if (code === null) {
49+
console.error(`Can't find "${props.capture}"`)
50+
}
51+
4552
return {
4653
code,
4754
}

0 commit comments

Comments
 (0)