vite-plugin-federation icon indicating copy to clipboard operation
vite-plugin-federation copied to clipboard

在remote端和host端不共享element-plus 分别按需加载,导致依赖 provide/inject 的组件上下文失效。

Open fanfan-le opened this issue 1 month ago • 5 comments

Versions

  • vite-plugin-federation:
  • vite:

Reproduction

Additional Details

Steps to reproduce

What is Expected?

What is actually happening?

fanfan-le avatar Dec 08 '25 12:12 fanfan-le

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Title: element-plus is not shared on the remote side and the host side and is loaded on demand respectively, causing the component context that relies on provide/inject to become invalid.

Issues-translate-bot avatar Dec 08 '25 12:12 Issues-translate-bot

autoImport({ imports: ["vue", "vue-router", "pinia"], resolvers: [OuryunPlusResolver(ElementPlusResolver), ElementPlusResolver({ importStyle: "sass" })], // 声明文件生成 dts: false, }), Components({ resolvers: [OuryunPlusResolver(ElementPlusResolver), ElementPlusResolver({ importStyle: "sass" })], dts: false, }),

fanfan-le avatar Dec 08 '25 12:12 fanfan-le

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


autoImport({ imports: ["vue", "vue-router", "pinia"], resolvers: [OuryunPlusResolver(ElementPlusResolver), ElementPlusResolver({ importStyle: "sass" })], // 声明文件生成 dts: false, }), Components({ resolvers: [OuryunPlusResolver(ElementPlusResolver), ElementPlusResolver({ importStyle: "sass" })], dts: false, }),

Issues-translate-bot avatar Dec 08 '25 12:12 Issues-translate-bot

实际产生的问题是 Element Plus 的 Form、Tabs 等组件大量依赖 provide/inject 导致 form表单校验不生效以及 el-tab 切换不生效

fanfan-le avatar Dec 08 '25 12:12 fanfan-le

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


The actual problem is that Element Plus' Form, Tabs and other components rely heavily on provide/inject, resulting in form verification not taking effect and el-tab switching not taking effect.

Issues-translate-bot avatar Dec 08 '25 12:12 Issues-translate-bot