uniapp+mp-html 优化ai聊天 支持markdown的形式

850 阅读1分钟

以下内容基于mp-html,通过npm的方式使用所支持的插件:官方文档地址如下:jin-yufeng.github.io/mp-html/#/a…

1. npm下载mp-html 完整代码

npm install mp-html

2. 找到需要使用的注释掉的插件,打开注释

位置在:node_modules/mp-tml/tools/config.js

image.png

3. 下载插件:

  1. 进入到目录下cd node_modules/mp-html
  2. npm install
  3. npm run build:uni-app
  4. 这样之后就可以在dist文件下找到刚刚下载的插件了

image.png

4. 最后我们就可以把刚才下载的插件,复制到我们要用的地方使用了

<template>
	<view class="mark-content">
		<mp-html :content="newText" :copy-link="false" @linktap="linktap" :markdown="true">
		</mp-html>
	</view>
</template>


image.png