Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

多组件引入的时候报错 #32

Open
mino01x opened this issue Mar 27, 2018 · 8 comments
Open

多组件引入的时候报错 #32

mino01x opened this issue Mar 27, 2018 · 8 comments

Comments

@mino01x
Copy link

mino01x commented Mar 27, 2018

[
  ["component", {"libraryName": "library1", "styleLibraryName": "styles"}],
  ["component", {"libraryName": "library2", "styleLibraryName": "styles"}]
]
import { component } from "library2"

// 会报 library1/lib/component 找不到
@mino01x mino01x changed the title 多组件引入的时候不报错 多组件引入的时候报错 Mar 27, 2018
@yoyou
Copy link

yoyou commented Mar 30, 2018

兄弟,这个问题解决了吗

@tengmaoqing
Copy link

我分析了下, 示例是错误的。多个lib的时候,引用方式应该是 这个形式:
["component", [{ "libraryName": "element-ui", "styleLibraryName": "theme-chalk" }, { "libraryName": "mint-ui", "style": true }]],

@yoyo837
Copy link

yoyo837 commented Jun 8, 2018

@tengmaoqing 也是有问题的 nuxt/nuxt#1603

@webuy-front
Copy link

我分析了下, 示例是错误的。多个lib的时候,引用方式应该是 这个形式:
["component", [{ "libraryName": "element-ui", "styleLibraryName": "theme-chalk" }, { "libraryName": "mint-ui", "style": true }]],

这种方式我这可以,之前是两个对象并列,有点第二个把第一个覆盖了的意思,现在放到一个数组里,就成了共存的了。。。以上纯属个人瞎猜,还是滚去看下源码把。。。

@ZinLiao
Copy link

ZinLiao commented Apr 3, 2019

我分析了下, 示例是错误的。多个lib的时候,引用方式应该是 这个形式:
["component", [{ "libraryName": "element-ui", "styleLibraryName": "theme-chalk" }, { "libraryName": "mint-ui", "style": true }]],

这种方式可以解决 +1

@yoyo837
Copy link

yoyo837 commented Apr 3, 2019

@ZinLiao 我这里不行,试过了

@ZinLiao
Copy link

ZinLiao commented Apr 3, 2019

@yoyo837
你的貌似是nuxt引起的吧,试下把nuxt的后端渲染关掉

@g8up
Copy link

g8up commented Jul 1, 2019

Multiple Modules

{
  "plugins": [
    [
      "component",
      [
        {
          "libraryName": "antd",
          "style": true
        },
        {
          "libraryName": "test-module",
          "style": true
        },
        // ...
      ]
    ]
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants