ant-design-vue icon indicating copy to clipboard operation
ant-design-vue copied to clipboard

Select render mismatch with csr(Client Side Render)

Open wheeljs opened this issue 3 years ago • 3 comments
trafficstars

  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.2.6

Environment

macOS Monterey version 12.4, Google Chrome Version 102.0.5005.115 (Official Build) (x86_64), [email protected]

Reproduction link

https://stackblitz.com/edit/vitejs-vite-evglmf?file=src%2FApp.vue

Steps to reproduce

  1. Setup a vite with ssr project by 'vite-ssr' module.
  2. Add <a-select mode="multiple"> into component, select multiple options.
  3. Only one selected options in <a-select> has remove icon.

What is expected?

All selected options should have remove icon after its label.

What is actually happening?

Only one selected options in <a-select> has remove icon.


Withour SSR(Works) reproduction link: https://stackblitz.com/edit/vitejs-vite-c6xqfq?file=src%2FApp.vue

I have also fire this issue in vite-ssr repo, ant-design-icons repo. Sorry for my English.

wheeljs avatar Jun 22 '22 03:06 wheeljs

As a workaround, I set removeIcon prop to "X"(character) instead of the default CloseOutlined from @ant-design/icons-vue, then <a-select> renders removeIcon for every selected option correctly. I think this may be an unexpected result with @ant-design/icons-vue not ant-design-vue. <CheckOutlined> in select options popover also have this problem. Reproduction link: https://stackblitz.com/edit/vitejs-vite-wpikk1?file=src%2FApp.vue

wheeljs avatar Jun 23 '22 02:06 wheeljs

应该是 vite-ssr 问题 它不支持 export { default }

tangjinzhou avatar Jun 23 '22 12:06 tangjinzhou

应该是 vite-ssr 问题 它不支持 export { default }

Thanks for your replying, is there have any workaround?

wheeljs avatar Jun 24 '22 04:06 wheeljs

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Aug 24 '22 03:08 github-actions[bot]

应该是 vite-ssr 问题 它不支持 export { default }

This is not the issue. Proof - this will not work (with vite ssr):

  1. create a very simple component
  2. use it in the icon slot
<a-select
mode="tags"
:options="options" 
>
  <template #removeIcon>
    <SimpleComponent />
  </template 
</a-select>

→ Component in icon slot will not render reliably However if the slot is something simple like a native HTML Element (for example <button>test</button>) it works.

Somehow vite will not render the HTML content of any component in this slot. Oddly enough the component itself will be attached correctly according to Vue.js devtools

Tested with the most recent version of vite and ant-design-vue.

vcasy avatar Nov 26 '22 21:11 vcasy

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Nov 27 '23 00:11 github-actions[bot]