vueComponent / ant-design-vue-nuxt

MIT License
68 stars 7 forks source link

首次进入 有短暂的时间没有style样式 #6

Closed linsxw closed 1 year ago

linsxw commented 1 year ago

页面刷新时或首次进入后,有短暂的时间没有样式,请问下如何解决

image
aibayanyu20 commented 1 year ago

这个后面应该会出一个解决方案#6659 参考ant-design的extract-ssr

tangjinzhou commented 1 year ago

@aibayanyu20 https://github.com/ant-design/static-style-extract 可以把这个 pr 到主库里

aibayanyu20 commented 1 year ago

@aibayanyu20 ant-design/static-style-extract 可以把这个 pr 到主库里

OK

vietanhbui commented 1 year ago

+1

thisisandreww commented 1 year ago

We are still waiting for a release from ant-design-vue right?

aibayanyu20 commented 1 year ago

We are still waiting for a release from ant-design-vue right?

Yes coming soon !

betteroneday commented 1 year ago

+1

betteroneday commented 1 year ago

I have reviewed the configuration in the document and the issue still remains unresolved. Can you please update the document to provide instructions on how to configure and resolve this problem?

aibayanyu20 commented 1 year ago

look at this https://github.com/vueComponent/ant-design-vue-nuxt/issues/15

I have reviewed the configuration in the document and the issue still remains unresolved. Can you please update the document to provide instructions on how to configure and resolve this problem?

thisisandreww commented 1 year ago

look at this #15

I have reviewed the configuration in the document and the issue still remains unresolved. Can you please update the document to provide instructions on how to configure and resolve this problem?

Thank you for the starter repo, while I was configuring the ConfigProvider within genAntdStyle, it's showing 'Invalid name ConfigProvider' https://www.antdv.com/docs/vue/ssr-extract-ssr

aibayanyu20 commented 1 year ago

look at this #15

I have reviewed the configuration in the document and the issue still remains unresolved. Can you please update the document to provide instructions on how to configure and resolve this problem?

Thank you for the starter repo, while I was configuring the ConfigProvider within genAntdStyle, it's showing 'Invalid name ConfigProvider' antdv.com/docs/vue/ssr-extract-ssr

Can you provide a reproduction?

thisisandreww commented 1 year ago

look at this #15

I have reviewed the configuration in the document and the issue still remains unresolved. Can you please update the document to provide instructions on how to configure and resolve this problem?

Thank you for the starter repo, while I was configuring the ConfigProvider within genAntdStyle, it's showing 'Invalid name ConfigProvider' antdv.com/docs/vue/ssr-extract-ssr

Can you provide a reproduction?

Attempting to add the config provider according to the docs, https://stackblitz.com/edit/github-52q5xr?file=scripts%2FgenAntdStyle.ts

aibayanyu20 commented 1 year ago

@thisisandreww try this https://stackblitz.com/edit/github-52q5xr-ve5njf?file=scripts%2FgenAntdStyle.ts

thisisandreww commented 1 year ago

@thisisandreww try this https://stackblitz.com/edit/github-52q5xr-ve5njf?file=scripts%2FgenAntdStyle.ts

That works! However, when I tried adding algorithm: theme.darkAlgorithm as the props, it seems to generate the exact same antd.css file as the one without dark algorithm.

eward957 commented 1 year ago

@thisisandreww try this https://stackblitz.com/edit/github-52q5xr-ve5njf?file=scripts%2FgenAntdStyle.ts

It doesn't work for me, it throw an error:

/User/xxx/xxx/node_modules/.pnpm/@ant-design+icons-vue@7.0.0_vue@3.3.4/node_modules/@ant-design/icons-vue/lib/utils.js:120
  return getRoot(ele) instanceof ShadowRoot;
                                 ^
ReferenceError: ShadowRoot is not defined

it looks like icon's problem, 'ShadowRoot' doesn't exist on node environment.

aibayanyu20 commented 1 year ago

@thisisandreww try this stackblitz.com/edit/github-52q5xr-ve5njf?file=scripts%2FgenAntdStyle.ts

It doesn't work for me, it throw an error:

/User/xxx/xxx/node_modules/.pnpm/@ant-design+icons-vue@7.0.0_vue@3.3.4/node_modules/@ant-design/icons-vue/lib/utils.js:120
  return getRoot(ele) instanceof ShadowRoot;
                                 ^
ReferenceError: ShadowRoot is not defined

it looks like icon's problem, 'ShadowRoot' doesn't exist on node environment.

Try downgrading @ant-design/icons-vue to 6.1.0

eward957 commented 1 year ago

@thisisandreww try this stackblitz.com/edit/github-52q5xr-ve5njf?file=scripts%2FgenAntdStyle.ts

It doesn't work for me, it throw an error:

/User/xxx/xxx/node_modules/.pnpm/@ant-design+icons-vue@7.0.0_vue@3.3.4/node_modules/@ant-design/icons-vue/lib/utils.js:120
  return getRoot(ele) instanceof ShadowRoot;
                                 ^
ReferenceError: ShadowRoot is not defined

it looks like icon's problem, 'ShadowRoot' doesn't exist on node environment.

Try downgrading @ant-design/icons-vue to 6.1.0

Succeed :) Thanks!

fskarmeta commented 11 months ago

hI, I can still reproduce the issue, here is an example, just refresh the page. Am I doing something wrong @aibayanyu20 ? Thanks beforehand :) https://stackblitz.com/edit/github-52q5xr-wk4qod?file=layouts%2Fdefault.vue,scripts%2FgenAntdStyle.ts