dev.html 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>KityMinder Example</title>
  6. <link href="favicon.ico" type="image/x-icon" rel="shortcut icon">
  7. <link rel="stylesheet" href="src/kityminder.css" rel="stylesheet">
  8. <style type="text/css">
  9. body {
  10. margin: 0;
  11. padding: 0;
  12. height: 100%;
  13. }
  14. #minder-view {
  15. position: absolute;
  16. border: 1px solid #ccc;
  17. left: 10px;
  18. top: 10px;
  19. bottom: 10px;
  20. right: 10px;
  21. }
  22. </style>
  23. <script type="text/javascript" src="node_modules/kity/dist/kity.js"></script>
  24. </head>
  25. <body>
  26. <script id="minder-view" type="application/kityminder" minder-data-type="json">
  27. {
  28. "root": {
  29. "data": {
  30. "text": "百度产品",
  31. "image": "https://www.baidu.com/img/bd_logo1.png?where=super",
  32. "imageSize": { "width": 270, "height": 129 }
  33. },
  34. "children": [
  35. { "data": { "text": "新闻" } },
  36. { "data": { "text": "网页", "priority": 1 } },
  37. { "data": { "text": "贴吧", "priority": 2 } },
  38. { "data": { "text": "知道", "priority": 2 } },
  39. { "data": { "text": "音乐", "priority": 3 } },
  40. { "data": { "text": "图片", "priority": 3 } },
  41. { "data": { "text": "视频", "priority": 3 } },
  42. { "data": { "text": "地图", "priority": 3 } },
  43. { "data": { "text": "百科", "priority": 3 } },
  44. { "data": { "text": "更多", "hyperlink": "http://www.baidu.com/more" } }
  45. ]
  46. }
  47. }
  48. </script>
  49. </body>
  50. <!-- *************************** Module 形式加载引入 **************************** -->
  51. <script type="text/javascript" src="node_modules/seajs/dist/sea-debug.js"></script>
  52. <script type="text/javascript">
  53. /* global seajs */
  54. seajs.config({
  55. base: './src'
  56. });
  57. define('start', function(require) {
  58. var Minder = require('kityminder').Minder;
  59. // 创建 km 实例
  60. var km = window.km = new Minder();
  61. km.setup('#minder-view');
  62. });
  63. seajs.use('start');
  64. </script>
  65. </html>