vueComponent / ant-design-vue

🌈 An enterprise-class UI components based on Ant Design and Vue. 🐜
https://antdv.com/
Other
20.33k stars 3.8k forks source link

Carousel component doesnt work with i18n and $t and ref #4259

Open yehechuan opened 3 years ago

yehechuan commented 3 years ago

Version

2.2.0-beta.5

Environment

Vue 3.1 browse all

Reproduction link

https://2x.antdv.com/components/carousel-cn

Steps to reproduce

$t as props in Carousel component

What is expected?

When i18n switching,renew the content changes accordingly

What is actually happening?

i18n not work in Carousel component

github-actions[bot] commented 3 years ago

Hello @yehechuan. Please provide a online reproduction by forking this link for vue2link for vue3 or a minimal GitHub repository. Make sure to choose the correct version.

你好 @yehechuan, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 此处 for vue2此处 for vue3 创建一个 codesandbox 或者提供一个最小化的 GitHub 仓库。请确保选择准确的版本。

yehechuan commented 3 years ago

Dear, 创建了一个codesandbox ,网址如下: https://fkw96.csb.app/ 问题:主要是Carousel中的语言不能实时切换。

With Best Regards

叶和川 (Kidy Ye)

QQ:2405284998 @.***

重庆嘉洋国际物流有限公司 CHONGQING WELL OCEAN LOGISTICS CO.,LTD ROOM2502,BLOCK A,COSMO,NO.41 JIALINYICUN,JIANGBEI DISTRICT,CHONGQING 地址:重庆江北区嘉陵一村41号观音桥COSMO A座25-2 TEL/FAX:023-67749887 Mobile:15823361997

From: github-actions[bot] Date: 2021-06-26 10:30 To: vueComponent/ant-design-vue CC: yehechuan; Mention Subject: Re: [vueComponent/ant-design-vue] Carousel component doesnt work with i18n and $t and ref (#4259) Hello @yehechuan. Please provide a online reproduction by forking this link for vue2、 link for vue3 or a minimal GitHub repository. Make sure to choose the correct version. 你好 @yehechuan, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 此处 for vue2、 此处 for vue3 创建一个 codesandbox 或者提供一个最小化的 GitHub 仓库。请确保选择准确的版本。 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

tangjinzhou commented 3 years ago

临时方案:加个key https://codesandbox.io/s/fkw96?file=/src/App.vue

yehechuan commented 3 years ago

没有看到能进行语言切换的解决方案。 这个组件显示图片还行,但是加上文字就效果不好。

With Best Regards

叶和川 (Kidy Ye)

QQ:2405284998 @.***

重庆嘉洋国际物流有限公司 CHONGQING WELL OCEAN LOGISTICS CO.,LTD ROOM2502,BLOCK A,COSMO,NO.41 JIALINYICUN,JIANGBEI DISTRICT,CHONGQING 地址:重庆江北区嘉陵一村41号观音桥COSMO A座25-2 TEL/FAX:023-67749887 Mobile:15823361997

From: tangjinzhou Date: 2021-07-01 15:16 To: vueComponent/ant-design-vue CC: yehechuan; Mention Subject: Re: [vueComponent/ant-design-vue] Carousel component doesnt work with i18n and $t and ref (#4259) 临时方案:加个key https://codesandbox.io/s/fkw96?file=/src/App.vue — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

sinjie commented 3 years ago

carousel 组建内部数据不会双向绑定,用方法formate数据的时候可以看得出来,函数进入数据已经改变,但是页面没有渲染, 原因: 轮播会复制多份dom(ul),只有其中一份(猜测原版)数据会双向绑定,而其他几份数据不会重新渲染

尝试过程: 在轮播到第二组数据时,截图发现数据是自己想要的,当移动完成后又变回原来的了

image

yehechuan commented 3 years ago

Dear, 还是采用给carousel组件绑定一个key,监控i18n的变化,然后更改key值,让组件重绘,就能解决了。

With Best Regards

叶和川 (Kidy Ye)

QQ:2405284998 @.***

重庆嘉洋国际物流有限公司 CHONGQING WELL OCEAN LOGISTICS CO.,LTD ROOM2502,BLOCK A,COSMO,NO.41 JIALINYICUN,JIANGBEI DISTRICT,CHONGQING 地址:重庆江北区嘉陵一村41号观音桥COSMO A座25-2 TEL/FAX:023-67749887 Mobile:15823361997

From: sinjie Date: 2021-08-20 17:18 To: vueComponent/ant-design-vue CC: yehechuan; Mention Subject: Re: [vueComponent/ant-design-vue] Carousel component doesnt work with i18n and $t and ref (#4259) carousel 组建内部数据不会双向绑定,用方法formate数据的时候可以看得出来,函数进入数据已经改变,但是页面没有渲染, 原因: 轮播会复制多份dom(ul),只有其中一份(猜测原版)数据会双向绑定,而其他几份数据不会重新渲染 尝试过程: 在轮播到第二组数据时,截图发现数据是自己想要的,当移动完成后又变回原来的了 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.