Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Zebra-h
Awesome-Markdown-Editor
提交
73f3a026
Awesome-Markdown-Editor
项目概览
Zebra-h
/
Awesome-Markdown-Editor
与 Fork 源项目一致
Fork自
gitcode_dev / Awesome-Markdown-Editor
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Awesome-Markdown-Editor
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
73f3a026
编写于
11月 11, 2021
作者:
郭
郭维嘉
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix
上级
faf4316f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
8 addition
and
10 deletion
+8
-10
src/App.vue
src/App.vue
+2
-2
src/assets/js/utils.js
src/assets/js/utils.js
+1
-1
src/components/content/components/toc-doc.vue
src/components/content/components/toc-doc.vue
+4
-2
src/components/content/mixins/render-mixins.js
src/components/content/mixins/render-mixins.js
+1
-1
src/main.js
src/main.js
+0
-4
未找到文件。
src/App.vue
浏览文件 @
73f3a026
...
@@ -547,9 +547,9 @@ export default {
...
@@ -547,9 +547,9 @@ export default {
},
},
addTocClickToBody
()
{
addTocClickToBody
()
{
document
.
querySelector
(
"
body
"
).
addEventListener
(
"
click
"
,
function
(
e
)
{
document
.
querySelector
(
"
body
"
).
addEventListener
(
"
click
"
,
function
(
e
)
{
if
(
!
e
.
target
?
.
className
.
includes
(
"
md_toc_item
"
))
return
;
if
(
!
e
.
target
.
className
.
includes
(
"
md_toc_item
"
))
return
;
const
targetEl
=
document
.
getElementById
(
const
targetEl
=
document
.
getElementById
(
e
.
target
?
.
getAttribute
(
"
href
"
)
e
.
target
.
getAttribute
(
"
href
"
)
);
);
if
(
!
targetEl
)
return
;
if
(
!
targetEl
)
return
;
targetEl
.
scrollIntoView
({
targetEl
.
scrollIntoView
({
...
...
src/assets/js/utils.js
浏览文件 @
73f3a026
...
@@ -184,7 +184,7 @@ export function isNotFalse(val) {
...
@@ -184,7 +184,7 @@ export function isNotFalse(val) {
}
}
export
function
pick
(
list
,
...
arg
)
{
export
function
pick
(
list
,
...
arg
)
{
if
(
!
list
.
length
||
!
arg
?.
length
)
return
;
if
(
!
list
.
length
||
!
(
arg
&&
arg
.
length
)
)
return
;
return
list
.
filter
(
item
=>
{
return
list
.
filter
(
item
=>
{
return
arg
.
find
(
key
=>
key
===
item
.
name
);
return
arg
.
find
(
key
=>
key
===
item
.
name
);
});
});
...
...
src/components/content/components/toc-doc.vue
浏览文件 @
73f3a026
...
@@ -59,7 +59,7 @@ export default {
...
@@ -59,7 +59,7 @@ export default {
},
},
computed
:
{
computed
:
{
topList
()
{
topList
()
{
return
this
.
dirTags
.
map
(
item
=>
Math
.
abs
(
item
?
.
top
));
return
this
.
dirTags
.
map
(
item
=>
Math
.
abs
(
item
&&
item
.
top
));
}
}
},
},
created
()
{
created
()
{
...
@@ -92,7 +92,9 @@ export default {
...
@@ -92,7 +92,9 @@ export default {
// ).scrollTop = targetOffsetTop;
// ).scrollTop = targetOffsetTop;
},
},
dirItemActive
(
item
)
{
dirItemActive
(
item
)
{
const
itemScrollTop
=
document
.
getElementById
(
item
.
id
)?.
offsetTop
;
const
targetEl
=
document
.
getElementById
(
item
.
id
);
if
(
!
targetEl
)
return
;
const
itemScrollTop
=
targetEl
.
offsetTop
;
const
top
=
this
.
scrollBarTop
-
itemScrollTop
;
const
top
=
this
.
scrollBarTop
-
itemScrollTop
;
this
.
$set
(
item
,
"
top
"
,
top
);
this
.
$set
(
item
,
"
top
"
,
top
);
return
Math
.
abs
(
top
)
===
Math
.
min
(...
this
.
topList
);
return
Math
.
abs
(
top
)
===
Math
.
min
(...
this
.
topList
);
...
...
src/components/content/mixins/render-mixins.js
浏览文件 @
73f3a026
...
@@ -142,7 +142,7 @@ export default {
...
@@ -142,7 +142,7 @@ export default {
return
"
<h
"
+
level
+
"
>
"
+
text
+
"
</h
"
+
level
+
"
>
\n
"
;
return
"
<h
"
+
level
+
"
>
"
+
text
+
"
</h
"
+
level
+
"
>
\n
"
;
},
},
link
(
href
,
title
,
text
)
{
link
(
href
,
title
,
text
)
{
if
(
text
?
.
toLowerCase
()
===
"
toc
"
)
{
if
(
text
&&
text
.
toLowerCase
()
===
"
toc
"
)
{
return
`
return
`
<h1 class="toc_title">
${
href
}
</h1>
<h1 class="toc_title">
${
href
}
</h1>
<div class="tocEl"></div>`
;
<div class="tocEl"></div>`
;
...
...
src/main.js
浏览文件 @
73f3a026
...
@@ -4,10 +4,6 @@ import Vtip from "vtip";
...
@@ -4,10 +4,6 @@ import Vtip from "vtip";
import
"
vtip/lib/index.min.css
"
;
import
"
vtip/lib/index.min.css
"
;
import
{
initStyle
,
setzIndex
,
isNotEmpty
}
from
"
@/assets/js/utils
"
;
import
{
initStyle
,
setzIndex
,
isNotEmpty
}
from
"
@/assets/js/utils
"
;
import
"
@/assets/style/global.less
"
;
import
"
@/assets/style/global.less
"
;
// import "@/assets/jupyter-render/dist/index.js";
// import "@/assets/jupyter-render/dist/assets/index.css";
Vue
.
use
(
Vtip
.
directive
);
Vue
.
use
(
Vtip
.
directive
);
function
initMdEditor
(
obj
)
{
function
initMdEditor
(
obj
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录