Antd横向子菜单“浮动”

创建一个包含可能分数的下拉列表。将其值查询到变量中。将变量作为addTimeSignature()方法的参数传递。


HTML:


<select id="TimeSignatureSelect">

    <option value='1/4'>1/4</option>

    <option value='2/4'>2/4</option>

    <option value='3/4'>3/4</option>

    <option value='4/4'>4/4</option>

</select>

JS:


const timeSig = document.getElementByID('TimeSignatureSelect').value;

stave.addClef("treble").addTimeSignature(timeSig);

http://img.mukewang.com/618399220001190503440152.jpg

米琪卡哇伊
浏览 291回答 1
1回答

梵蒂冈之花

由于Ant 是一个设计系统,因此不建议这样做,您可以通过定位.ant-menu-submenu > .ant-menu选择器来实现它:/* ./App.css */.ant-menu-submenu > .ant-menu {&nbsp; margin-top: -5px;}// index.jsimport { Layout, Menu } from 'antd';import 'antd/dist/antd.css';import './App.css';function MainMenu() {&nbsp; return (&nbsp; &nbsp; <Layout>&nbsp; &nbsp; &nbsp; <Menu mode="horizontal" openKeys={['submenu']}>&nbsp; &nbsp; &nbsp; &nbsp; <Menu.Item key="home">Home</Menu.Item>&nbsp; &nbsp; &nbsp; &nbsp; <Menu.SubMenu&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; key="submenu"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; title="SubMenu"&nbsp; &nbsp; &nbsp; &nbsp; >&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <Menu.Item key="1">Option 1</Menu.Item>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <Menu.Item key="2">Option 2</Menu.Item>&nbsp; &nbsp; &nbsp; &nbsp; </Menu.SubMenu>&nbsp; &nbsp; &nbsp; &nbsp; <Menu.Item key="contact">Contact</Menu.Item>&nbsp; &nbsp; &nbsp; </Menu>&nbsp; &nbsp; </Layout>&nbsp; );}
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript