以下是我的文件:
定价.js
import React, { Component } from 'react';
import { Table } from 'react-bootstrap';
class Pricing extends Component {
render() {
return (
<Table striped bordered condensed>
<thead>
<th></th>
<th>Community</th>
<th>Business</th>
<th>Enterprise</th>
</thead>
<tbody>
<tr>
<td>Cost</td>
<td>Free</td>
<td>Free</td>
<td>Free</td>
</tr>
</tbody>
</Table>
);
}
}
export default Pricing;
索引.js
export { Pricing } from './Pricing';
主程序
import React from 'react';
import { Switch, Route } from 'react-router-dom';
import Pricing from '../../pages/Pricing';
const Main = () => (
<main>
<Switch>
<Route path='/pricing' component={Pricing}/>
</Switch>
</main>
)
export default Main;
我收到以下错误:
35:70-77“在'../../pages/Pricing'中找不到导出'默认'(导入为'定价')