Open ccforeverd opened 4 years ago
2.13.1
electron@8.2.3
2.6.11
https://github.com/ccforeverd/electron-tmp3
vue create . # with typescript vue add electron-builder vue add element-ui ncu -u yarn
update tsconfig.json
tsconfig.json
{ "compilerOptions": { ... "types": [ "webpack-env", "element-ui", "vuetify", "jest" ], "typeRoots": [ "./node_modules/element-ui/types" ], ... } }
add src/components/TestElementUI.tsx
src/components/TestElementUI.tsx
import { Vue, Component } from 'vue-property-decorator' import { Button } from 'element-ui' @Component export default class App extends Vue { public text = 'main-app' protected render (): JSX.Element { return ( <main> <Button type="primary">{this.text}</Button> </main> ) } }
type yarn electron:serve
yarn electron:serve
then throw error in editor and webpack output:
{ "resource": "/Users/zhangshuyao/Sites/electron/electron-tmp3/src/components/TestElementUI.tsx", "owner": "typescript", "code": "2769", "severity": 8, "message": "No overload matches this call.\n Overload 1 of 3, '(options?: ThisTypedComponentOptionsWithArrayProps<Vue, object, object, object, never> | undefined): Button', gave the following error.\n 不能将类型“{ type: string; }”分配给类型“ThisTypedComponentOptionsWithArrayProps<Vue, object, object, object, never>”。\n 类型“ThisTypedComponentOptionsWithArrayProps<Vue, object, object, object, never>”上不存在属性“type”。\n Overload 2 of 3, '(options?: ThisTypedComponentOptionsWithRecordProps<Vue, object, object, object, object> | undefined): Button', gave the following error.\n 不能将类型“{ type: string; }”分配给类型“ThisTypedComponentOptionsWithRecordProps<Vue, object, object, object, object>”。\n 类型“ThisTypedComponentOptionsWithRecordProps<Vue, object, object, object, object>”上不存在属性“type”。\n Overload 3 of 3, '(options?: ComponentOptions<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<Record<string, any>>, Record<...>> | undefined): Button', gave the following error.\n 不能将类型“{ type: string; }”分配给类型“ComponentOptions<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<Record<string, any>>, Record<...>>”。\n 类型“ComponentOptions<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<Record<string, any>>, Record<...>>”上不存在属性“type”。", "source": "ts", "startLineNumber": 14, "startColumn": 17, "endLineNumber": 14, "endColumn": 21 }
no error
throw error in editor and webpack output:
+1
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Element UI version
2.13.1
OS/Browsers version
electron@8.2.3
Vue version
2.6.11
Reproduction Link
https://github.com/ccforeverd/electron-tmp3
Steps to reproduce
update
tsconfig.json
add
src/components/TestElementUI.tsx
type
yarn electron:serve
then throw error in editor and webpack output:
What is Expected?
no error
What is actually happening?
throw error in editor and webpack output: