{"id":23148825,"url":"https://github.com/houxiaozhao/h-richeditor","last_synced_at":"2025-08-17T17:34:15.743Z","repository":{"id":57259936,"uuid":"144374737","full_name":"houxiaozhao/h-richeditor","owner":"houxiaozhao","description":"VUE 简单的移动端富文本编辑器","archived":false,"fork":false,"pushed_at":"2022-07-22T12:40:58.000Z","size":345,"stargazers_count":9,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-09T13:01:02.529Z","etag":null,"topics":["mobile","richeditor","vue"],"latest_commit_sha":null,"homepage":"","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/houxiaozhao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-11T10:03:39.000Z","updated_at":"2024-08-04T08:46:22.000Z","dependencies_parsed_at":"2022-08-25T01:51:37.188Z","dependency_job_id":null,"html_url":"https://github.com/houxiaozhao/h-richeditor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houxiaozhao%2Fh-richeditor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houxiaozhao%2Fh-richeditor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houxiaozhao%2Fh-richeditor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houxiaozhao%2Fh-richeditor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/houxiaozhao","download_url":"https://codeload.github.com/houxiaozhao/h-richeditor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230032415,"owners_count":18162488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mobile","richeditor","vue"],"created_at":"2024-12-17T17:13:15.760Z","updated_at":"2024-12-17T17:13:16.331Z","avatar_url":"https://github.com/houxiaozhao.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# h-richeditor\n\n\u003e 简单的移动端富文本编辑器\n\u003e 在 h-richeditor 上重新发布了一个包，之前那个不知道怎么搞的，我没有权限发布了。😭\n\u003e 改了个名字，使用方式都没有变\n\n## 使用\n\n```bash\n# install dependencies\nnpm i h-richeditor\n## OR\nyarn add h-richeditor\n```\n\n#### `main.js`中\n\n```javascript\nimport Vue from 'vue';\nimport RichEditor from 'h-richeditor';\nVue.use(RichEditor);\n```\n\n#### 组件中\n\n```vue\n\u003crich-editor :title.sync=\"title\" :description.sync=\"description\" placeholder=\"标题\" contentplaceholder=\"内容\" :hasTitle=true\u003e\n\u003c/rich-editor\u003e\n```\n\n![](https://github.com/houxiaozhao/h-richeditor/blob/master/src/assets/img2.png?raw=true)\n\n![](https://github.com/houxiaozhao/h-richeditor/blob/master/src/assets/img.png?raw=true)\n\n#### 其他\n\n- 使用了 lrz 依赖，用来压缩图片。\n\n- 支持添加图片，粘贴图片到文本框。\n\n- 如果不使用 npm 安装，可以 clone 下来直接复制`src/components`文件夹到项目中。自行修改样式。\n\n- 逻辑比较简单 主要是使用了 contenteditable 这个属性。\n\n- 图片处理稍微复杂一些\n\n  - 直接点击上传按钮添加图片\n\n    得到图片后压缩，添加到 img 标签，然后添加到内容中。\n\n  - 粘贴添加图片\n\n    在 div 上添加监听粘贴事件，得到图片后把图片添加到 div 上，然后还要把事件 emit 到父组件，在绑定的字符串中添加图片\n\n- 实现了双向绑定，一定要添加 sync 修饰符\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhouxiaozhao%2Fh-richeditor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhouxiaozhao%2Fh-richeditor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhouxiaozhao%2Fh-richeditor/lists"}