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

网站建设常用代码有限公司怎么纳税

网站建设常用代码,有限公司怎么纳税,西安h5网站建设,企业网站的推广阶段ByteMD bytedance/bytemd: ByteMD v1 repository (github.com) 这里由于我的项目是 Next,所以安装 bytemd/react, 阅读官方文档,执行命令来安装编辑器主体、以及 gfm(表格支持)插件、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-css
import '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 className="md-editor"><Editorvalue={value || ""}placeholder={placeholder}mode="split"plugins={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 className="md-viewer"><Viewer 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] = useState<string>('');<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

编辑器模式

<template><MdEditor v-model="text" />
</template><script setup>
import { ref } from 'vue';
import { MdEditor } from 'md-editor-v3';
import 'md-editor-v3/lib/style.css';const text = ref('# Hello Editor');
</script>

仅预览模式

<template><MdPreview :editorId="id" :modelValue="text" /><MdCatalog :editorId="id" :scrollElement="scrollElement" />
</template><script 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.yayakq.cn/news/589204/

相关文章:

  • 最受欢迎国内设计网站上海外贸仓库
  • 江门网站推广深圳公司玉环网站建设
  • 郑州网站建设兄长好山西电力建设一公司网站
  • 广州市网站建设分站价格360投放广告怎么收费
  • 网站备案申请书上海十大管理咨询公司
  • 怎么查看网站是哪个公司建的买过域名之前就可以做网站了吗?
  • 旅游网站对比模板seo赚钱方式
  • 网站搜索框设计学校网站logo怎么做
  • 虚拟主机怎么设计网站吗猪八戒网设计官网
  • 如何建立一个私人网站开发一个软件大概需要多少钱
  • 徐州网站客户做网站图片软件
  • 做网站 学php哪一部分2017网站icp备案
  • 如何做网站框架花店网站建设需求
  • ps 怎么做网站中国科技成就作文
  • 鲜花网站建设的目标郴州网签备案查询系统
  • 网站怎么做维护做网站需要那些东西
  • 制作营销网站模板导航网站头部代码
  • 信息化建设 网站建设等方面做调查问卷哪个网站好
  • 利用网站宣传腐倡廉建设工作报道个人特种作业证查询
  • 软件开发工具属于哪种类型的软件衡水百度seo
  • 湖北省建设厅官方网站证书查询政工网站建设方案
  • 网站建设的难点在哪里三亚旅游网站建设
  • 网站建设流程包括图片设计软件有哪些
  • 古典风格网站模板html如何免费做一个网站攻略
  • 建网站需成本多少钱天津网站优化排名
  • 楼市南京做凶宅的网站网站备案背景
  • 手机如何建设网站导航网站制作教程
  • 江苏住房和建设厅网站欧式风格装修效果图
  • 惠州外贸网站建设免费网站建设工具
  • 汶上网站开发做区位分析的地图网站