Skip to content

Commit

Permalink
fix: 文档上传插件未找到 server
Browse files Browse the repository at this point in the history
  • Loading branch information
fghpdf committed Jun 12, 2019
1 parent 7bd6fa7 commit 24e60d8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
node_modules
index.js
bundle
dist
dist
*.go
go.mod
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
</script>
```

ps: 容器 id 请勿使用 sm-editor toolbar-wrapper ql-history history-sidebar history-content history-container

#### 通过 typescript 方式开发
我们提供了完整的 type 来提升开发体验

Expand Down
5 changes: 3 additions & 2 deletions document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default class ShimoDocumentCabinet extends CabinetBase {

const toolbarContainer = this.getDom("toolbar-wrapper");

editor.render(this.getDom("editor"), {
editor.render(this.getDom("sm-editor"), {
readOnly: !this.editorOptions.editable,
id: this.user.id,
localeConfig,
Expand Down Expand Up @@ -237,9 +237,10 @@ export default class ShimoDocumentCabinet extends CabinetBase {
public initUploader(editor: ShimoSDK.Document.Editor): ShimoSDK.Document.Uploader {
const options: ShimoSDK.Document.UploaderOptions = {
editor,
container: "#editor",
container: "#sm-editor",
url: this.editorOptions.uploadConfig.origin,
accessToken: this.editorOptions.uploadConfig.token,
type: this.editorOptions.uploadConfig.server,
};

const uploader: ShimoSDK.Document.Uploader = new this.sdkDocument.plugins.Uploader(options);
Expand Down
3 changes: 2 additions & 1 deletion example/document/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
}
}).then(function (res) {
window.shimoParameter.file = res.data
})
}) // 未部署后端建议直接使用假数据
// file: {"head":1,"content":"[[10, \"\\n\", \"line:\\\"init\\\"\"]]","guid":"i2piw5AxT4cRrgm4"}
}
}

Expand Down

0 comments on commit 24e60d8

Please sign in to comment.