{"id":16907989,"url":"https://github.com/dream2023/docute-plugin-run","last_synced_at":"2025-03-20T17:17:06.558Z","repository":{"id":57214380,"uuid":"227988069","full_name":"dream2023/docute-plugin-run","owner":"dream2023","description":"docute 在线运行 Vue 单文件","archived":false,"fork":false,"pushed_at":"2019-12-14T08:27:54.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-25T21:18:20.778Z","etag":null,"topics":["docute","docute-demo","docute-editor","docute-plugin","docute-sfc","docute-vue","vue-run-sfc"],"latest_commit_sha":null,"homepage":"https://dream2023.github.io/docute-plugin-run/#/docs.md","language":"HTML","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/dream2023.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":"2019-12-14T08:08:37.000Z","updated_at":"2023-11-02T07:13:30.000Z","dependencies_parsed_at":"2022-08-26T13:41:32.551Z","dependency_job_id":null,"html_url":"https://github.com/dream2023/docute-plugin-run","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/dream2023%2Fdocute-plugin-run","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dream2023%2Fdocute-plugin-run/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dream2023%2Fdocute-plugin-run/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dream2023%2Fdocute-plugin-run/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dream2023","download_url":"https://codeload.github.com/dream2023/docute-plugin-run/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244656740,"owners_count":20488640,"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":["docute","docute-demo","docute-editor","docute-plugin","docute-sfc","docute-vue","vue-run-sfc"],"created_at":"2024-10-13T18:49:42.400Z","updated_at":"2025-03-20T17:17:06.539Z","avatar_url":"https://github.com/dream2023.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docute-plugin-run | docute 在线运行 Vue 单文件\n\n## 🍏 介绍\n\n`docute-plugin-run` 通过对 [vue-run-sfc](https://github.com/dream2023/vue-run-sfc) 的封装, 实现了 docute 在线运行和编辑 Vue 单文件的能力, 简直是写 DEMO 福音, 再也不用担心 `JSFiddle` 或 `Codepen` 无法访问了.\n\n```html\n``html run\n\u003ctemplate\u003e\n  \u003ch2 class=\"title\"\u003e{{name}} DEMO利器!\u003c/h2\u003e\n\u003c/template\u003e\n\u003cscript\u003e\n  export default {\n    data () {\n      return {\n        name: 'docute-plugin-run'\n      }\n    }\n  }\n\u003c/script\u003e\n\u003cstyle\u003e\n  .title {\n    color: #009688;\n  }\n\u003c/style\u003e\n``  \u003c== 这里和上面的 ` 有 3 个\n```\n\n## DEMO \u0026 DOC\n[https://dream2023.github.io/docute-plugin-run/](https://dream2023.github.io/docute-plugin-run/#/docs.md)\n\n## 🍎 使用\n\n```html\n\u003c!-- 先引入 docute-plugin-run --\u003e\n\u003cscript src=\"https://unpkg.com/docute-plugin-run\"\u003e\u003c/script\u003e\n\u003c!-- 再引入 docute.js --\u003e\n\u003cscript src=\"https://unpkg.com/docute@4/dist/docute.js\"\u003e\u003c/script\u003e\n\u003c!-- 再引入 vue-run-sfc --\u003e\n\u003cscript src=\"https://unpkg.com/vue-run-sfc\"\u003e\u003c/script\u003e\n\n\u003c!-- 再进行注册--\u003e\n\u003cscript\u003e\n  new Docute({\n    plugins: [\n      docutePluginRun({\n        // 配置(可选), 更多属性解释请往下面翻 ↓\n        themeColor: 'green',\n        themeBorderColor: '#eee',\n        reverse: true,\n        // ...\n      })\n    ],\n  })\n\u003c/script\u003e\n```\n\n## 🍊示例\n\n### 全局配置: 运行 element-ui\n\n```js\n\u003cscript\u003e\n  new Docute({\n    plugins: [\n      docutePluginRun({\n        jsLabs: ['https://unpkg.com/element-ui/lib/index.js'],\n        cssLabs: ['https://unpkg.com/element-ui/lib/theme-chalk/index.css'],\n      })\n    ]\n  })\n\u003c/script\u003e\n```\n\n```html\n``html run\n\u003ctemplate\u003e\n  \u003cel-tabs type=\"border-card\"\u003e\n    \u003cel-tab-pane label=\"用户管理\"\u003e用户管理\u003c/el-tab-pane\u003e\n    \u003cel-tab-pane label=\"配置管理\"\u003e配置管理\u003c/el-tab-pane\u003e\n    \u003cel-tab-pane label=\"角色管理\"\u003e角色管理\u003c/el-tab-pane\u003e\n    \u003cel-tab-pane label=\"定时任务补偿\"\u003e定时任务补偿\u003c/el-tab-pane\u003e\n  \u003c/el-tabs\u003e\n\u003c/template\u003e\n``  \u003c== 这里和上面的 ` 有 3 个\n```\n\n### 局部配置: 自定义显示\n\n```html\n``html run {title: '局部配置', height: '200px', row: true}\n\u003ctemplate\u003e\n  \u003cdiv\u003e通过局部配置实现\u003cb\u003e高度自定义\u003c/b\u003e和\u003cb\u003e左右布局\u003c/b\u003e\u003c/div\u003e\n\u003c/template\u003e\n\u003cstyle\u003e\nb {\n  color: #009688;\n}\n\u003c/style\u003e\n`` \u003c== 这里和上面的 ` 有 3 个\n```\n\n## 🍇 配置属性列表\n\n具体属性请参考: [vue-run-sfc](https://github.com/dream2023/vue-run-sfc#props-%E5%B1%9E%E6%80%A7%E8%AF%B4%E6%98%8E)\n\n```js\n{\n  /**\n   * js 库\n   * @example: ['https://unpkg.com/element-ui/lib/index.js']\n   */\n  jsLabs: Array,\n\n  /**\n   * css 库\n   * @example: ['https://unpkg.com/element-ui/lib/theme-chalk/index.css']\n   */\n  cssLabs: Array,\n\n  /**\n   * js 字符串\n   * @example: 'alert(1)'\n   */\n  js: [Array, String],\n\n  /**\n   * css 字符串\n   * @example: 'body { color: red }'\n   */\n  css: [Array, String],\n\n  // 主题色\n  // 默认值为: #009688\n  themeColor: {\n    type: String,\n    default: '#009688'\n  },\n\n  // 主题色\n  // 默认值为: #009688\n  themeBorderColor: {\n    type: String,\n    default: 'rgba(0,0,0,.07)'\n  },\n\n  /**\n   * 代码编辑器和效果预览排列方式\n   * 当为 false 时, 上下排列\n   * 当为 true 时, 左右排列\n   */\n  row: Boolean,\n\n  /**\n   * 当 `row` 为 true 时, 编辑区和展示区上下位置\n   * 当为 false 时, 编辑器在下, 展示区在上\n   * 当为 true 时, 编辑器在上, 展示区在下\n   */\n  reverse: Boolean,\n\n  /**\n   * 高度\n   * @example: '400px'\n   */\n  height: String,\n\n  /**\n   * 初始加载是否打开编辑区\n   * 当为 false 时, 默认是关闭编辑区\n   * 当为 true 时, 默认是打开编辑区\n   */\n  open: Boolean,\n  /**\n   * 是否隐藏头部\n   */\n  isHideHeader: Boolean\n}\n```\n\n## 相关链接\n\n- [vue-run-sfc](https://github.com/dream2023/vue-run-sfc)\n- [vuep.run](http://vuep.run/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdream2023%2Fdocute-plugin-run","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdream2023%2Fdocute-plugin-run","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdream2023%2Fdocute-plugin-run/lists"}