通用评论 vedio

index.example.js.map 5.6KB

1
  1. {"version":3,"sources":["../src/index.example.js"],"names":["Index","props","state","page","value","onPageChange","bind","handleChangeValue","handleChangeSubmit","setState","console","log","text","files","loading","setTimeout","msg","response","status","Promise","resolve","Component","ReactDOM","render","document","getElementById"],"mappings":";;;;AAAA;;;;AACA;;;;AAIA;;;;AACA;;;;;;;;;;;AAJA;AACA;AACA;;;IAIMA,K;;;AACJ,iBAAYC,KAAZ,EAAmB;AAAA;;AAAA,8GACXA,KADW;;AAEjB,UAAKC,KAAL,GAAa;AACXC,YAAM,CADK;AAEXC,aAAO;AAFI,KAAb;AAIA,UAAKC,YAAL,GAAoB,MAAKA,YAAL,CAAkBC,IAAlB,OAApB;AACA,UAAKC,iBAAL,GAAyB,MAAKA,iBAAL,CAAuBD,IAAvB,OAAzB;AACA,UAAKE,kBAAL,GAA0B,MAAKA,kBAAL,CAAwBF,IAAxB,OAA1B;AARiB;AASlB;;;;iCAEYH,I,EAAM;AACjB,WAAKM,QAAL,CAAc;AACZN;AADY,OAAd;AAGD;;;sCAEiBC,K,EAAO;AACvB,WAAKK,QAAL,CAAc,EAAEL,YAAF,EAAd;AACAM,cAAQC,GAAR,CAAY,2BAAZ,EAAyCP,KAAzC;AACD;;;6CAEmC;AAAA;;AAAA,UAAfQ,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;AACE,gBAAM,CADR;AAEE,sBAAW,MAFb;AAGE,gCAHF;AAIE,8BAJF;AAKE,8BALF;AAME,qBAAW,KANb;AAOE,kBAAQ,KAPV;AAQE,gBAAM,KAAKX,KAAL,CAAWC,IARnB;AASE,wBAAc,KAAKE,YATrB;AAUE,oBAAS,MAVX;AAWE,mBAAS,iBAACW,GAAD,SAAuB;AAAA,gBAAfC,QAAe,SAAfA,QAAe;;AAC9B,gBAAIA,SAASC,MAAT,KAAoB,GAAxB,EAA6B;AAC3BR,sBAAQC,GAAR,CAAY,WAAZ;AACD;AACDD,oBAAQC,GAAR,iBAA0BK,GAA1B;AACD;AAhBH;AAkBE,sCAAC,WAAD;AACE,qBAAW,CADb;AAEE,yBAFF;AAGE,wBAAc,wBAAM;AAClB,mBAAO,IAAIG,OAAJ,CAAY,mBAAW;AAC5BC,sBAAQ,IAAR;AACD,aAFM,CAAP;AAGD,WAPH;AAQE,4BAAkB,4BAAM;AACtBV,oBAAQC,GAAR,CAAY,MAAZ;AACD,WAVH;AAWE,qBAAW,KAXb;AAYE,mBAAS,iBAACK,GAAD,SAAuB;AAAA,gBAAfC,QAAe,SAAfA,QAAe;;AAC9B,gBAAIA,SAASC,MAAT,KAAoB,GAAxB,EAA6B;AAC3BR,sBAAQC,GAAR,CAAY,WAAZ;AACD;AACDD,oBAAQC,GAAR,iBAA0BK,GAA1B;AACD;AAjBH;AAlBF,OADF;;AAyCA;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;;;;EAnHiBK,gB;;AAsHpBC,mBAASC,MAAT,CAAgB,8BAAC,KAAD,OAAhB,EAA2BC,SAASC,cAAT,CAAwB,cAAxB,CAA3B;AACA","file":"index.example.js","sourcesContent":["import React, { Component } from \"react\";\nimport ReactDOM from \"react-dom\";\n// e.g.\n// import { Button, Icon } from \"antd\";\n// import App, { Editor, RenderText } from \"./App\";\nimport App, { Editor } from \"./App\";\nimport registerServiceWorker from \"./registerServiceWorker\";\n\nclass Index extends Component {\n constructor(props) {\n super(props);\n this.state = {\n page: 1,\n value: \"\"\n };\n this.onPageChange = this.onPageChange.bind(this);\n this.handleChangeValue = this.handleChangeValue.bind(this);\n this.handleChangeSubmit = this.handleChangeSubmit.bind(this);\n }\n\n onPageChange(page) {\n this.setState({\n page\n });\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\n type={1}\n businessId=\"test\"\n showAlertComment\n showAlertReply\n showAlertFavor\n showError={false}\n userId={71299}\n page={this.state.page}\n onPageChange={this.onPageChange}\n pageType=\"more\"\n onError={(msg, { response }) => {\n if (response.status === 401) {\n console.log(\"unlogined\");\n }\n console.log(`-----------${msg}`);\n }}\n >\n <Editor\n maxUpload={9}\n autoFocus\n beforeSubmit={() => {\n return new Promise(resolve => {\n resolve(true);\n });\n }}\n onCommentSuccess={() => {\n console.log(\"succ\");\n }}\n showError={false}\n onError={(msg, { response }) => {\n if (response.status === 401) {\n console.log(\"unlogined\");\n }\n console.log(`-----------${msg}`);\n }}\n />\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"]}