Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
曲幽
Awesome-Markdown-Editor
提交
effa9596
Awesome-Markdown-Editor
项目概览
曲幽
/
Awesome-Markdown-Editor
与 Fork 源项目一致
Fork自
gitcode_dev / Awesome-Markdown-Editor
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Awesome-Markdown-Editor
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
effa9596
编写于
8月 05, 2021
作者:
璃白.
🌻
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update README.md
上级
dfcb2e0c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
69 addition
and
3 deletion
+69
-3
README.md
README.md
+69
-3
未找到文件。
README.md
浏览文件 @
effa9596
...
...
@@ -9,10 +9,10 @@
2021-08-05 v0.7更新,添加功能:
-
支持@指定用户
-
支持网址渲染成卡片样式
-
支持@指定用户
[
queryUserList
](
#queryuserlist
)
-
支持网址渲染成卡片样式
[
renderLinks
](
#renderlinks
)
-
优化标签过滤规则
-
添加
disable属性
-
添加
[
disable属性
](
#toolsoptions
)
### v0.6
...
...
@@ -122,6 +122,8 @@ new MdEditor({
| onChange | 获取编辑器markdown及html内容 | Function | function(res) {}
[
示例
](
#onchange
)
| onUpload | 上传文件钩子函数 | Function | function(file, callback) {}
[
示例
](
#onupload
)
| onsubmit | 快捷键函数 | Function | function(file, callback) {}
[
示例
](
#onsubmit
)
| queryUserList | @用户列表查询函数 | Function | function(keyword), callback) {}
[
示例
](
#queryuserlist
)
| renderLinks | 把链接渲染成卡片样式 | Function | function(list)), callback) {}
[
示例
](
#renderlinks
)
# 方法
...
...
@@ -275,6 +277,70 @@ new MdEditor({
})
```
# queryUserList
按下@键时触发此函数,通过回传用户列表可生成用户选择弹窗
```
js
new
MdEditor
({
...,
queryUserList
:
function
(
val
,
callback
)
{
const
list
=
[
{
nickname
:
"
王一博
"
,
username
:
'
cpongo4
'
,
url
:
"
https://weibo.com/u/5492443184
"
,
avatar
:
"
https://img2.baidu.com/it/u=298051053,3773223854&fm=26&fmt=auto&gp=0.jpg
"
},
{
nickname
:
"
王俊凯
"
,
username
:
'
cpongo5
'
,
url
:
"
https://weibo.com/tfwangjunkai
"
,
avatar
:
"
https://img1.baidu.com/it/u=2378425879,2273515018&fm=26&fmt=auto&gp=0.jpg
"
},
{
nickname
:
"
易烊千玺
"
,
username
:
'
cpongo6
'
,
url
:
"
https://weibo.com/tfyiyangqianxi
"
,
avatar
:
"
https://img0.baidu.com/it/u=2227200088,1939721201&fm=26&fmt=auto&gp=0.jpg
"
},
{
nickname
:
"
白敬亭
"
,
username
:
'
cpongo7
'
,
url
:
"
https://weibo.com/u/2112496475
"
,
avatar
:
"
https://img1.baidu.com/it/u=3265411836,2089649447&fm=11&fmt=auto&gp=0.jpg
"
}
];
callback
(
list
);
}
})
```
# renderLinks
通过返回的链接信息把链接渲染成卡片样式
```
js
renderLinks
:
function
(
val
,
callback
)
{
const
newLinks
=
val
.
map
(
item
=>
{
item
.
title
=
"
指定的可执行文件cmd.exe未能运行,某某函数不正确-后端-CSDN问答
"
;
item
.
icon
=
"
https://g.csdnimg.cn/static/logo/favicon32.ico
"
;
item
.
description
=
"
CSDN问答为您找到指定的可执行文件cmd.exe未能运行,某某函数不正确相关问题答案,如果想了解更多关于指定的可执行文件cmd.exe未能运行,某某函数不正确 asp.net、c# 技术问题等相关问答,请访问CSDN问答。
"
;
return
item
;
});
callback
(
newLinks
);
},
```
# getValue
获取编辑器内容
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录