mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
Application.jsx
This commit is contained in:
parent
e84236a2b1
commit
562a3d30e8
@ -9,35 +9,13 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="container">
|
||||
|
||||
</div>
|
||||
<div id="container"></div>
|
||||
<script src="js/react.js"></script>
|
||||
<script src="js/react-dom.js"></script>
|
||||
<script src="build/ShadowEditor.UI.js"></script>
|
||||
<script>
|
||||
var icon1 = React.createElement(Shadow.Icon, {
|
||||
icon: 'translate',
|
||||
key: 1,
|
||||
});
|
||||
|
||||
var icon2 = React.createElement(Shadow.Icon, {
|
||||
icon: 'rotate',
|
||||
key: 2,
|
||||
});
|
||||
|
||||
var icon3 = React.createElement(Shadow.Icon, {
|
||||
icon: 'scale',
|
||||
key: 3,
|
||||
});
|
||||
|
||||
var toolbar = React.createElement(Shadow.Toolbar, undefined, [
|
||||
icon1,
|
||||
icon2,
|
||||
icon3,
|
||||
]);
|
||||
|
||||
ReactDOM.render(toolbar, document.querySelector('#container'));
|
||||
var app = new Shadow.Application();
|
||||
app.render();
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
||||
14
ShadowEditor.UI/src/Application.jsx
Normal file
14
ShadowEditor.UI/src/Application.jsx
Normal file
@ -0,0 +1,14 @@
|
||||
import Panel from './panel/Panel.jsx';
|
||||
|
||||
/**
|
||||
* 应用程序
|
||||
*/
|
||||
class Application {
|
||||
render() {
|
||||
const component = <Panel></Panel>;
|
||||
|
||||
ReactDOM.render(component, document.querySelector('#container'));
|
||||
}
|
||||
}
|
||||
|
||||
export default Application;
|
||||
@ -9,10 +9,16 @@ export { default as HBoxLayout } from './layout/HBoxLayout.jsx';
|
||||
export { default as VBoxLayout } from './layout/VBoxLayout.jsx';
|
||||
|
||||
// menu
|
||||
export { default as Toolbar } from './menu/Toolbar.jsx';
|
||||
export { default as MenuBar } from './menu/MenuBar.jsx';
|
||||
|
||||
// panel
|
||||
export { default as Panel } from './panel/Panel.jsx';
|
||||
|
||||
// toolbar
|
||||
export { default as Toolbar } from './toolbar/Toolbar.jsx';
|
||||
|
||||
// window
|
||||
export { default as Alert } from './window/Alert.jsx';
|
||||
|
||||
// application
|
||||
export { default as Application } from './Application.jsx';
|
||||
17
ShadowEditor.UI/src/menu/MenuBar.jsx
Normal file
17
ShadowEditor.UI/src/menu/MenuBar.jsx
Normal file
@ -0,0 +1,17 @@
|
||||
import classNames from 'classnames/bind';
|
||||
|
||||
/**
|
||||
* 菜单栏
|
||||
* @author tengge / https://github.com/tengge1
|
||||
* @property {String} className 样式类
|
||||
* @property {String} children 内容
|
||||
*/
|
||||
class MenuBar extends React.Component {
|
||||
render() {
|
||||
const { className, children } = this.props;
|
||||
|
||||
return <div className={classNames('MenuBar', className)}>{children}</div>;
|
||||
}
|
||||
}
|
||||
|
||||
export default MenuBar;
|
||||
Loading…
x
Reference in New Issue
Block a user