1 |
- {"version":3,"sources":["../src/index.js"],"names":["Index","props","state","value","handleChangeValue","bind","handleChangeSubmit","setState","console","log","text","files","loading","setTimeout","Component","ReactDOM","render","document","getElementById"],"mappings":";;;;AAAA;;;;AACA;;;;AAGA;;;;AACA;;;;;;;;;;;AAHA;AACA;;;IAIMA,K;;;AACJ,iBAAYC,KAAZ,EAAmB;AAAA;;AAAA,8GACXA,KADW;;AAEjB,UAAKC,KAAL,GAAa;AACXC,aAAO;AADI,KAAb;AAGA,UAAKC,iBAAL,GAAyB,MAAKA,iBAAL,CAAuBC,IAAvB,OAAzB;AACA,UAAKC,kBAAL,GAA0B,MAAKA,kBAAL,CAAwBD,IAAxB,OAA1B;AANiB;AAOlB;;;;sCAEiBF,K,EAAO;AACvB,WAAKI,QAAL,CAAc,EAAEJ,YAAF,EAAd;AACAK,cAAQC,GAAR,CAAY,2BAAZ,EAAyCN,KAAzC;AACD;;;6CAEmC;AAAA;;AAAA,UAAfO,IAAe,QAAfA,IAAe;AAAA,UAATC,KAAS,QAATA,KAAS;;AAClC,WAAKJ,QAAL,CAAc,EAAEK,SAAS,IAAX,EAAd,EAAiC,YAAM;AACrCC,mBAAW,YAAM;AACf,iBAAKN,QAAL,CAAc,EAAEK,SAAS,KAAX,EAAd;AACD,SAFD,EAEG,IAFH;AAGD,OAJD;AAKAJ,cAAQC,GAAR,CAAY,eAAZ,EAA6BC,IAA7B;AACAF,cAAQC,GAAR,CAAY,gBAAZ,EAA8BE,KAA9B;AACD;;;6BAEQ;AACP;AACA,aACE;AAAC,qBAAD;AAAA,UAAK,MAAM,CAAX,EAAc,YAAW,MAAzB;AACE,sCAAC,WAAD;AADF,OADF;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACD;;;;EAxEiBG,gB;;AA2EpBC,mBAASC,MAAT,CAAgB,8BAAC,KAAD,OAAhB,EAA2BC,SAASC,cAAT,CAAwB,cAAxB,CAA3B;AACA","file":"index.js","sourcesContent":["import React, { Component } from 'react';\nimport ReactDOM from 'react-dom';\n// e.g.\n// import { Button, Icon } from \"antd\";\nimport App, { Editor, RenderText } from './App';\nimport registerServiceWorker from './registerServiceWorker';\n\nclass Index extends Component {\n constructor(props) {\n super(props);\n this.state = {\n value: '',\n };\n this.handleChangeValue = this.handleChangeValue.bind(this);\n this.handleChangeSubmit = this.handleChangeSubmit.bind(this);\n }\n\n handleChangeValue(value) {\n this.setState({ value });\n console.log('handleChangeValue value: ', value);\n }\n\n handleChangeSubmit({ text, files }) {\n this.setState({ loading: true }, () => {\n setTimeout(() => {\n this.setState({ loading: false });\n }, 2000);\n });\n console.log('submit text: ', text);\n console.log('submit files: ', files);\n }\n\n render() {\n // 最简单的用法\n return (\n <App type={1} businessId=\"test\">\n <Editor />\n </App>\n );\n\n // e.g.\n // 复杂的用户法\n // const props = {\n // type: 1,\n // businessId: \"1\",\n // API: \"http://api.links123.net/comment/v1\",\n // showList: true\n // };\n\n // const editorProps = {\n // showEmoji: true,\n // placeholder: \"说点什么吧\",\n // rows: 5,\n // btnLoading: this.state.loading,\n // btnDisable: this.state.loading,\n // btnSubmitText: \"提交\",\n // value: this.state.value,\n // onChange: v => this.handleChangeValue(v),\n // onSubmit: v => this.handleChangeSubmit(v),\n // button: (\n // <Button\n // type=\"primary\"\n // ghost\n // // onClick={() => console.log('click btn: ', this.state.value)}\n // >\n // 自定义按钮\n // </Button>\n // ),\n // emojiToolIcon: <Icon type=\"smile\" style={{ fontSize: 23 }} />,\n // imageToolIcon: (\n // <Icon type=\"cloud-upload-o\" style={{ fontSize: 25, marginLeft: 10 }} />\n // )\n // };\n\n // return (\n // <App {...props}>\n // <Editor {...editorProps} />\n // </App>\n // );\n }\n}\n\nReactDOM.render(<Index />, document.getElementById('root-comment'));\nregisterServiceWorker();\n"]}
|