Skip to content

Commit

Permalink
修复BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
mtsee committed Nov 7, 2019
1 parent 38ad3e9 commit f8af592
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 63 deletions.
31 changes: 15 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 35,16 @@ QQ群:549856478
### 1. 引入必须的资源包。

```html
<link rel="stylesheet" href="https://at.alicdn.com/t/font_157397_ze6q8vjbeme.css">
<link href="https://cdn.bootcss.com/Swiper/4.5.0/css/swiper.min.css" rel="stylesheet">
<link href="https://cdn.bootcss.com/antd/3.23.0-beta.0/antd.min.css" rel="stylesheet">
<!-- 编辑器所需第三方资源库 -->
<script src="https://cdn.h5ds.com/lib/plugins/swiper.min.js"></script>
<script src="https://cdn.h5ds.com/lib/plugins/jquery.min.js"></script>
<script src="https://cdn.h5ds.com/lib/plugins/h5ds.vendor.min.js"></script>
<!-- 外部引入antd -->
<script src="https://cdn.bootcss.com/moment.js/2.24.0/moment.min.js"></script>
<script src="https://cdn.bootcss.com/antd/3.23.0-beta.0/antd.min.js"></script>
<link rel="stylesheet" href="https://at.alicdn.com/t/font_157397_ujac0trx9i.css">
<link href="https://cdn.h5ds.com/lib/plugins/swiper.min.css" rel="stylesheet">
<link href="https://cdn.bootcss.com/antd/3.23.0-beta.0/antd.min.css" rel="stylesheet">
<!-- 编辑器所需第三方资源库 -->
<script src="https://cdn.h5ds.com/lib/plugins/swiper.min.js"></script>
<script src="https://cdn.h5ds.com/lib/plugins/jquery.min.js"></script>
<script src="https://cdn.h5ds.com/lib/plugins/h5ds.vendor.min.js"></script>
<!-- 外部引入antd -->
<script src="https://cdn.bootcss.com/moment.js/2.24.0/moment.min.js"></script>
<script src="https://cdn.bootcss.com/antd/3.23.0-beta.0/antd.min.js"></script>
```

### 2. 安装使用H5DS
Expand Down Expand Up @@ -129,19 129,18 @@ export default Editor;
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>H5DS</title>
<link rel="stylesheet" href="https://cdn.h5ds.com/umd/editor/style.css" />
<link rel="stylesheet" href="https://at.alicdn.com/t/font_157397_ze6q8vjbeme.css"/>
<link href="https://cdn.bootcss.com/Swiper/4.5.0/css/swiper.min.css" rel="stylesheet"/>
<link href="https://cdn.bootcss.com/antd/3.23.0-beta.0/antd.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="https://at.alicdn.com/t/font_157397_ujac0trx9i.css">
<link href="https://cdn.h5ds.com/lib/plugins/swiper.min.css" rel="stylesheet">
<link href="https://cdn.bootcss.com/antd/3.23.0-beta.0/antd.min.css" rel="stylesheet">
<!-- 编辑器所需第三方资源库 -->
<script src="https://cdn.h5ds.com/lib/plugins/swiper.min.js"></script>
<script src="https://cdn.h5ds.com/lib/plugins/jquery.min.js"></script>
<script src="https://cdn.h5ds.com/lib/plugins/h5ds.vendor.min.js"></script>
<!-- 外部引入antd --->
<!-- 外部引入antd -->
<script src="https://cdn.bootcss.com/moment.js/2.24.0/moment.min.js"></script>
<script src="https://cdn.bootcss.com/antd/3.23.0-beta.0/antd.min.js"></script>
<!-- es6语法支持 -->
<script src="https://cdn.staticfile.org/babel-standalone/6.26.0/babel.min.js"></script>
<script src="https://cdn.bootcss.com/lib/babel/6.26.0/babel.min.js"></script>
<!-- H5DS资源 -->
<script src="https://cdn.h5ds.com/umd/editor/index.js"></script>
</head>
Expand Down
26 changes: 4 additions & 22 deletions browser/h5ds.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 5,16 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>H5DS</title>
<link rel="stylesheet" href="https://cdn.h5ds.com/umd/editor/style.css" />
<link
rel="stylesheet"
href="https://at.alicdn.com/t/font_157397_ze6q8vjbeme.css"
/>
<link
rel="stylesheet"
href="https://at.alicdn.com/t/font_1160472_ybl2xl0ao8.css"
/>
<link
href="https://cdn.bootcss.com/Swiper/4.5.0/css/swiper.min.css"
rel="stylesheet"
/>
<link
href="https://cdn.bootcss.com/antd/3.23.0-beta.0/antd.min.css"
rel="stylesheet"
/>
<link rel="stylesheet" href="https://at.alicdn.com/t/font_157397_ujac0trx9i.css">
<link href="https://cdn.h5ds.com/lib/plugins/swiper.min.css" rel="stylesheet">
<link href="https://cdn.bootcss.com/antd/3.23.0-beta.0/antd.min.css" rel="stylesheet">
<!-- 编辑器所需第三方资源库 -->
<script src="https://cdn.h5ds.com/lib/plugins/swiper.min.js"></script>
<script src="https://cdn.h5ds.com/lib/plugins/jquery.min.js"></script>
<script src="https://cdn.h5ds.com/lib/plugins/h5ds.vendor.min.js"></script>
<!-- 外部引入antd --->
<!-- 外部引入antd -->
<script src="https://cdn.bootcss.com/moment.js/2.24.0/moment.min.js"></script>
<script src="https://cdn.bootcss.com/antd/3.23.0-beta.0/antd.min.js"></script>
<!-- es6语法支持 -->
<script src="https://cdn.staticfile.org/babel-standalone/6.26.0/babel.min.js"></script>
<!-- H5DS资源 -->
<script src="https://cdn.h5ds.com/umd/editor/index.js"></script>
</head>
<body></body>
<script type="text/babel">
Expand Down
7 changes: 5 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 16,14 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="shortcut icon" href="/assets/images/favicon.ico">
<link rel="stylesheet" href="https://at.alicdn.com/t/font_157397_ze6q8vjbeme.css"/>
<link rel="stylesheet" href="https://at.alicdn.com/t/font_1160472_ybl2xl0ao8.css"/>
<link rel="stylesheet" href="https://at.alicdn.com/t/font_157397_ujac0trx9i.css">
<link href="https://cdn.h5ds.com/lib/plugins/swiper.min.css" rel="stylesheet">
<link href="https://cdn.bootcss.com/antd/3.23.0-beta.0/antd.min.css" rel="stylesheet">
<!-- 编辑器所需第三方资源库 -->
<script src="https://cdn.h5ds.com/lib/plugins/swiper.min.js"></script>
<script src="https://cdn.h5ds.com/lib/plugins/jquery.min.js"></script>
<script src="https://cdn.h5ds.com/lib/plugins/h5ds.vendor.min.js"></script>
<!-- 外部引入antd -->
<script src="https://cdn.bootcss.com/moment.js/2.24.0/moment.min.js"></script>
<script src="https://cdn.bootcss.com/antd/3.23.0-beta.0/antd.min.js"></script>
</head>
Expand Down
23 changes: 3 additions & 20 deletions src/pages/home/home-index/HomeIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 7,7 @@ import H5dsEditor from 'h5ds';
import ImageList from './ImageList';

// 载入自定义插件
import * as demo from '../../../plugins/demo';
import '../../../plugins/demo';

@inject('user')
@observer
Expand Down Expand Up @@ -48,30 48,13 @@ class Editor extends Component {
// const { H5dsEditor } = H5DS_GLOBAL.editor;
return (
<H5dsEditor
plugins={[
'h5ds-form',
'h5ds-video',
'h5ds-map',
'h5ds-button',
'h5ds-save-to-image',
'h5ds-drawer-menu',
'h5ds-css-effect',
'h5ds-count-time',
'h5ds-chart',
'h5ds-qrcode',
'swiper-cube',
'swiper-overflow',
'swiper-flip',
'swiper-slide',
'threejs-360',
'threejs-obj-loader'
]} // 第三方插件包
plugins={[]} // 第三方插件包
data={data}
debugger={false} // debugger=true用于调试插件
options={{
noServer: true, // 开启无后台模式
imageSourceModal: ImageList,
pluginsHost: 'https://www.h5ds.com',
// pluginsHost: 'https://www.h5ds.com',
publishApp: this.publishApp,
saveApp: this.saveApp, // 保存应用
appId: 'test_app_id' // 当前appId
Expand Down
10 changes: 9 additions & 1 deletion src/plugins/demo/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 5,7 @@ import React, { Component } from 'react';
const icon = <i className="h5ds-ico h5ds-ico-xingzhuang" />;

/**
* props: h5ds, scope, layer
* props: h5ds, scope, layer mobx
*/
class Editor extends Component {
constructor(props) {
Expand All @@ -16,10 16,18 @@ class Editor extends Component {
window.pubSubInstance.publish('demo.show.modal');
};

changeData = () => {
this.props.layer.data = new Date();
this.props.h5ds.updateCanvas();
}

render() {
return (
<div className="editor-mantou-demo">
<button onClick={this.showModal}>点击弹窗</button>
<br/>
<br/>
<button onClick={this.changeData}>修改data</button>
</div>
);
}
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/demo/Layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 9,10 @@ import { mountPlugin } from 'h5ds-mount-plugin';
* props: layer, renderIn, plugins{pluginsKey}, isRenderThis
*/
class LayerComp extends React.Component {

render() {
const { data } = this.props.layer;
return <div className="layerinner-mantou-demo">{data}123123123</div>;
return <div className="layerinner-mantou-demo">{data}</div>;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/demo/LayerJSON.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 8,5 @@ export class LayerJSON {
style = { width: 200, height: 200, top: 0, left: 0 }; // div.layer 的样式
estyle = {}; // div.element 的样式
events = [];
data = 'test hello!';
data = 'hello!'; // {}
}
3 changes: 3 additions & 0 deletions src/plugins/demo/layer.less
Original file line number Diff line number Diff line change
@@ -1,3 1,6 @@
.layerinner-mantou-demo{
background: red;
font-size: 20px;
color: #fff;
font-weight: bolder;
}

0 comments on commit f8af592

Please sign in to comment.