fix: lint

This commit is contained in:
07akioni 2024-07-20 22:24:12 +08:00
parent 899f79f8a2
commit 7a805289de
3 changed files with 20 additions and 21 deletions

View File

@ -40,13 +40,13 @@ import { useRoute } from 'vitepress'
const { Layout } = DefaultTheme
const CssRenderStyle = defineComponent({
setup () {
setup() {
const collect = inject('css-render-collect')
return {
style: collect()
}
},
render () {
render() {
return h('css-render-style', {
innerHTML: this.style
})
@ -54,7 +54,7 @@ const CssRenderStyle = defineComponent({
})
const VitepressPath = defineComponent({
setup () {
setup() {
const route = useRoute()
return () => {
return h('vitepress-path', null, [route.path])
@ -63,7 +63,7 @@ const VitepressPath = defineComponent({
})
const NaiveUIProvider = defineComponent({
render () {
render() {
return h(
NConfigProvider,
{ abstract: true, inlineThemeDisabled: true },
@ -116,10 +116,11 @@ export default defineConfig({
},
transformHtml(code, id) {
const html = id.split('/').pop()
if (!html) return
if (!html)
return
const style = fileAndStyles[`/${html}`]
if (style) {
return code.replace(/<\/head>/, style + '</head>')
return code.replace(/<\/head>/, `${style}</head>`)
}
}
})

View File

@ -40,13 +40,13 @@ import { useRoute } from 'vitepress'
const { Layout } = DefaultTheme
const CssRenderStyle = defineComponent({
setup () {
setup() {
const collect = inject('css-render-collect')
return {
style: collect()
}
},
render () {
render() {
return h('css-render-style', {
innerHTML: this.style
})
@ -54,7 +54,7 @@ const CssRenderStyle = defineComponent({
})
const VitepressPath = defineComponent({
setup () {
setup() {
const route = useRoute()
return () => {
return h('vitepress-path', null, [route.path])
@ -63,7 +63,7 @@ const VitepressPath = defineComponent({
})
const NaiveUIProvider = defineComponent({
render () {
render() {
return h(
NConfigProvider,
{ abstract: true, inlineThemeDisabled: true },
@ -116,10 +116,11 @@ export default defineConfig({
},
transformHtml(code, id) {
const html = id.split('/').pop()
if (!html) return
if (!html)
return
const style = fileAndStyles[`/${html}`]
if (style) {
return code.replace(/<\/head>/, style + '</head>')
return code.replace(/<\/head>/, `${style}</head>`)
}
}
})

View File

@ -32,17 +32,14 @@ export default defineComponent({
const scrollHeight = containerRef?.scrollHeight
const clientHeight = containerRef?.clientHeight
const scrollTop = containerRef?.scrollTop
if (
containerRef &&
scrollHeight !== undefined &&
clientHeight !== undefined &&
scrollTop !== undefined
containerRef
&& scrollHeight !== undefined
&& clientHeight !== undefined
&& scrollTop !== undefined
) {
if (
scrollTop + clientHeight >=
scrollHeight - props.distance
) {
if (scrollTop + clientHeight >= scrollHeight - props.distance) {
loading = true
try {
await props.onLoad?.()