-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using the Menu component but getting an error #1127
Comments
嗨, 我在我的项目中使用 以下为React版本和Element-react版本
以下为源代码 // App.jsx
import './App.css';
import { Menu } from 'element-react';
function App() {
const onOpen = () => {
console.log('onOpen');
}
const onClose = () => {
console.log('onClose');
}
return (
<main>
<div className="nav">
<Menu
defaultActive="2"
className="el-menu-vertical-demo"
/* onOpen={this.onOpen.bind(this)}
onClose={this.onClose.bind(this)} */
>
<Menu.SubMenu index="1" title="导航一">
<Menu.ItemGroup title="分组一">
<Menu.Item index="1-1">选项1</Menu.Item>
<Menu.Item index="1-2">选项2</Menu.Item>
</Menu.ItemGroup>
<Menu.ItemGroup title="分组2">
<Menu.Item index="1-3">选项3</Menu.Item>
</Menu.ItemGroup>
</Menu.SubMenu>
<Menu.Item index="2">导航二</Menu.Item>
<Menu.Item index="3">导航三</Menu.Item>
</Menu>
</div>
</main>
);
}
export default App; // main.jsx
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import App from './App.jsx';
import './index.css';
import 'element-theme-default';
createRoot(document.getElementById('root')).render(
<StrictMode>
<App />
</StrictMode>
); 以下为报错信息
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I'm using the
Menu
component in my project, although some content can be displayed and works fine, but the second level or even multi-level menus don't work correctly, checking the console there is an error messageHere is the React version and Element-react version.
Here are the React version and the Element-react version
Here is the source code
The following is the error message
The text was updated successfully, but these errors were encountered: