""./todos"" 没有导出的成员 "TodoS"。你是想改用 "import TodoS from "./todos"" 吗?ts(2614) import TodoS
时间: 2024-07-01 15:00:45 浏览: 167
The error message you're encountering, `ts(2614)`, in TypeScript typically indicates a type or namespace issue. The error "Module './todos' has no exported member 'TodoS'" suggests that the `todos` module does not have an exported variable, function, or class named `TodoS`. In your code, you are trying to import `TodoS` from the `./todos` module, but it is not being properly exported.
To fix this issue, you need to ensure that `TodoS` is either:
1. Exported from the `./todos.ts` file using the `export` keyword, like so:
```typescript
// todos.ts
export class TodoS { ... }
```
2. If `TodoS` is a class, you might have intended to use a class export instead of a variable:
```typescript
// todos.ts
export default class TodoS { ... }
```
3. If you meant to use an interface, make sure to `export` it:
```typescript
// todos.ts
export interface TodoS { ... }
```
After making the appropriate changes to export `TodoS`, you can then import it as you mentioned:
```typescript
import TodoS from "./todos";
```
Remember to check the `todos.ts` file for any missing or incorrect exports, and update your import statement accordingly. If there's no such class, interface, or object to export, you'll need to remove or adjust your import.
阅读全文