MWC Web组件导致重复的标识符打字稿错误

问题描述

在我的Stencil应用程序中,我正在使用mwc-formfield,复选框,textfield等组件。之前我们使用Material-Web-Components或mdc表示这些元素,现在我们正在尝试逐步淘汰使用前者。但是,对于某些mwc组件,Typescript为MDC组件抛出多个重复的标识符错误。例如formfield,slider等。这是我的package.json:

dependencies {
    "material-components-web": "^7.0.0","@material/mwc-button": "^0.19.1","@material/mwc-formfield": "^0.19.1","@material/mwc-icon-button": "^0.18.0","@material/mwc-list": "^0.18.0","@material/mwc-radio": "^0.19.1","@material/mwc-select": "^0.18.0","@material/mwc-snackbar": "^0.18.0","@material/mwc-switch": "^0.19.1","@material/mwc-textfield": "^0.18.0"
}

还有我的tsconfig

{
    "compilerOptions": {
        "allowSyntheticDefaultImports": true,"allowUnreachableCode": false,"declaration": true,"declarationMap": true,"declarationDir": "dist/types","experimentalDecorators": true,"lib": [
            "dom","es2017"
        ],"moduleResolution": "node","module": "esnext","target": "es2017","noUnusedLocals": false,"noUnusedParameters": false,"jsx": "react","jsxFactory": "h","types": ["node"],"outDir": "dist"
    },"include": [
        "src"
    ],"exclude": [
        "node_modules","/test/","**/*.spec.*","**/*.stories.*","**/root-component/*","**/__mocks__/*",]
}

如果有人遇到过这个问题,我们该如何解决?请帮忙!

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)