如何解决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__/*",]
}
如果有人遇到过这个问题,我们该如何解决?请帮忙!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。