当前位置: 首页 > news >正文

海外网站建设教程厦门网站建设屈兴东

海外网站建设教程,厦门网站建设屈兴东,做视频的模板下载网站,网络营销策划方案3000字ByteMD bytedance/bytemd: ByteMD v1 repository (github.com) 这里由于我的项目是 Next#xff0c;所以安装 bytemd/react#xff0c; 阅读官方文档#xff0c;执行命令来安装编辑器主体、以及 gfm#xff08;表格支持#xff09;插件、highlight 代码高亮插件#xf…ByteMD bytedance/bytemd: ByteMD v1 repository (github.com) 这里由于我的项目是 Next所以安装 bytemd/react 阅读官方文档执行命令来安装编辑器主体、以及 gfm表格支持插件、highlight 代码高亮插件 npm i bytemd/react npm i bytemd/plugin-highlight bytemd/plugin-gfm但是浏览器的样式不好看我们可以引入第三方主题 github-markdown-css npm install github-markdown-cssimport github-markdown-css/github-markdown-light.css;然后使用组件 src/components/MdEditor/index.tsx import { Editor } from bytemd/react; import gfm from bytemd/plugin-gfm; import highlight from bytemd/plugin-highlight; import github-markdown-css/github-markdown-light.css; import bytemd/dist/index.css; import highlight.js/styles/vs.css; import ./index.css;interface Props {value?: string;onChange?: (v: string) void;placeholder?: string; }const plugins [gfm(), highlight()];/*** Markdown 编辑器* param props* constructor*/ const MdEditor (props: Props) {const { value , onChange, placeholder } props;return (div classNamemd-editorEditorvalue{value || }placeholder{placeholder}modesplitplugins{plugins}onChange{onChange}//div); };export default MdEditor;把 MdEditor 当前输入的值暴露给父组件便于父组件去使用同时也是提高组件的通用性所以定义了属性和属性类型把 value 和 onChange 事件交给父组件去管理。 src/components/MdEditor/index.css .md-editor {.bytemd-toolbar-icon.bytemd-tippy.bytemd-tippy-right:last-child {display: none;} }隐藏编辑器中不需要的操作图标像 GitHub 图标 编辑好文本自然有浏览文本的地方所以浏览器 src/components/MdViewer/index.tsx import { Viewer } from bytemd/react; import gfm from bytemd/plugin-gfm; import highlight from bytemd/plugin-highlight; import github-markdown-css/github-markdown-light.css; import bytemd/dist/index.css; import highlight.js/styles/vs.css; import ./index.css;interface Props {value?: string; }const plugins [gfm(), highlight()];/*** Markdown 浏览器* param props* constructor*/ const MdViewer (props: Props) {const { value } props;return (div classNamemd-viewerViewer value{value} plugins{plugins} //div); };export default MdViewer;src/components/MdViewer/index.css .md-viewer {.bytemd-toolbar-icon.bytemd-tippy.bytemd-tippy-right:last-child {display: none;} }可以在任意客户端渲染页面或组件引入组件进行测试这是因为该组件用到了 useRef 之类的仅客户端才支持的函数。 const [text, setText] useStatestring();MdEditor value{text} onChange{setText} / MdViewer value{text} /md-editor-v3 文本编辑器/md-editor-v3 (gitee.com) 这个是之前写 Vue3 用过的一个编辑器也很不错用法简单同样支持 Vue、React 等。 安装 yarn add md-editor-v3更多使用及贡献方式参考md-editor-extension 编辑器模式 templateMdEditor v-modeltext / /templatescript setup import { ref } from vue; import { MdEditor } from md-editor-v3; import md-editor-v3/lib/style.css;const text ref(# Hello Editor); /script仅预览模式 templateMdPreview :editorIdid :modelValuetext /MdCatalog :editorIdid :scrollElementscrollElement / /templatescript setup import { ref } from vue; import { MdPreview, MdCatalog } from md-editor-v3; import md-editor-v3/lib/preview.css;const id preview-only; const text ref(# Hello Editor); const scrollElement document.documentElement; /script
http://www.hkea.cn/news/14547163/

相关文章:

  • 受欢迎的常州做网站seo对网络推广的作用是
  • 义乌网站建设微信开发青岛网站建设公司正
  • 嘉兴建站公司windows优化大师有哪些功能
  • php做网站主要怎么布局shopify建站流程
  • php电商网站开发流程常州网站关键字优化
  • 网站代码如何优化平台网站制作
  • 企业做网站的意义北苑网站建设公司
  • 网站的设计风格与特点江西做网站建设
  • 广州专业网站设计公司百度怎么优化关键词排名
  • 月租网站空间如何判断网站数据库类型
  • 上海城乡建设网站首页贺州网络推广
  • aspnet网站开发实例网站建设的实习报告
  • 合肥做企业网站的网络公司企业网站和域名的好处
  • linux网站如何做ip解析网址大全有用吗
  • 公司网站欢迎语赣州安全教育平台
  • 网站设计外文文献cd wordpress
  • 福建住房与城乡建设厅网站专业软文
  • 辽宁省交通建设投资集团官方网站公众号平台网页版登录入口
  • seo公司是怎么做的网站建设优化规划书
  • 做旅游网站的设计感想境外企业网站推广
  • asp 网站图标做的网站为什么手机上搜不到
  • 中小企业建站的方法产品设计网站制作
  • 福田专业做网站公司免费素材网png
  • 织梦dedeeims网站打不开如何在google上免费推广
  • 物流公司网站建设方案邢台网站设计
  • 平台网站制作公司网龙网络公司校园招聘
  • 住房和城乡建设部网站安全分会wordpress地产主题
  • 番禺人才网站wordpress数字交易主题
  • 国外做免费的视频网站有哪些广州机械加工
  • 长沙设计网站公司网站建设要购买服务器吗