Closed darknoll closed 2 years ago
同样遇到这种情况。 node:17.2.0 npm:7.18.1 OS:Windows 10 64Bit
Pleaseeeeeeeee help me! Its mostly disaster for me.
I had been remove the package.json
dependencies step on step, but i can not fixing that.
Trying to use umd
format import that packaged file.
@hzm18
@darknoll
import ElementPlus from 'element-plus/dist/index.full';
import { defineNuxtPlugin } from '#app';
export default defineNuxtPlugin(nuxtApp => {
nuxtApp.vueApp.use(ElementPlus);
});
@YunYouJun maybe have a solution elegant more than here.
my two cents:
When we use nuxt
, we should be providing two build format, the one be in order to be used by ssr
-- its commonJs
format. other one be in order to be used by browser
-- its esm
format.
We can not to use import element-plus/lib
and import element-plus
to import element-plus
, so that we should be using lement-plus/dist/index.full
-- its is compatible with commonJs
and esm
.
You save my life. But the button style is still not working. No style is applied if I change the button type to primary.
You save my life. But the button style is still not working. No style is applied if I change the button type to primary.
export default defineNuxtConfig({
css: [
'element-plus/dist/index.css'
]
})
You save my life. But the button style is still not working. No style is applied if I change the button type to primary.
export default defineNuxtConfig({ css: [ 'element-plus/dist/index.css' ] })
This doesn't work. I have already tried it. It only works on client only.
Okay. trying to open a new issue, Its will help you.
@vueuse/core/nuxt
migrate to @vueuse/nuxt
, we need to wait a little time.
Uncaught Error: Dynamic require of "@vueuse/core" is not supported at chunk-EABY2BFN.js:26 at node_modules/element-plus/lib/hooks/use-modal/index.js (element-plus_lib.js:7476) at require2 (chunk-EABY2BFN.js:32) at node_modules/element-plus/lib/hooks/index.js (element-plus_lib.js:10983) at require2 (chunk-EABY2BFN.js:32) at node_modules/element-plus/lib/make-installer.js (element-plus_lib.js:11039) at require2 (chunk-EABY2BFN.js:32) at node_modules/element-plus/lib/defaults.js (element-plus_lib.js:65543) at require2 (chunk-EABY2BFN.js:32) at node_modules/element-plus/lib/index.js (element-plus_lib.js:65921)