brc-dd / vitepress-with-arco

1 stars 3 forks source link

Referring to your repository configuration, it still doesn't work #1

Closed Charles7c closed 2 years ago

Charles7c commented 2 years ago

Could you please help me check where the configuration is wrong? Thank you!

Charles7c commented 2 years ago

https://github.com/Charles7c/charles7c.github.io

Charles7c commented 2 years ago

Before, Arco was introduced in the way of Element Plus, dev running style and so on was fine, but errors were reported during build. https://github.com/Charles7c/charles7c.github.io/runs/7702184010?check_suite_focus=true

brc-dd commented 2 years ago

Things seem to be working fine in your latest code except for some reason your global components aren't getting registered. Removing them, the build succeeds.

Charles7c commented 2 years ago

It's a headache. I'm a back-end developer. I hope I can get your help. :)

Charles7c commented 2 years ago

.vitepress/theme/index.ts

import DefaultTheme from 'vitepress/theme'
import MyLayout from "./MyLayout.vue"
import ArcoVue from '@arco-design/web-vue'
import '@arco-design/web-vue/dist/arco.css'
import './styles/vars.css'
import './styles/custom.css'
import ArticleMetadata from './components/ArticleMetadata.vue'
import Tag from './components/Tag.vue'
import Archive from './components/Archive.vue'

export default {
  ...DefaultTheme,
  Layout: MyLayout,
  enhanceApp({ app }) {
    // 全局注册ArcoDesignVue
    app.use(ArcoVue)

    app.component('ArticleMetadata', ArticleMetadata)
    app.component('Tag', Tag)
    app.component('Archive', Archive)
  }
}

I actually needed to introduce arco in its entirety, but I got an error building. Can you write an example similar to the vitepress-element-plus-demo? vitepress-arco-design-vue-demo, yarn dev and yarn build without error.

brc-dd commented 2 years ago

Can you write an example similar to the vitepress-element-plus-demo? vitepress-arco-design-vue-demo, yarn dev and yarn build without error.

https://github.com/brc-dd/vitepress-arco-design-vue-demo

I actually needed to introduce arco in its entirety

This isn't recommended though. Even in my example you'll see very large chunks being generated.

Charles7c commented 2 years ago

image Thank you, I have seen that I also configured like this, but it still reported an error. Is it because I use icons alone?

Charles7c commented 2 years ago

oky! I deleted all my files, then added them little by little, tried dev and build again and again, and finally the problem was found to be the use of icons. https://github.com/Charles7c/charles7c.github.io/blob/main/repos/.vitepress/theme/components/Archive.vue

Charles7c commented 2 years ago

I'll find out how to use its icon. thank you.