Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Richard 祝发兴 - -IT
Awesome-Markdown-Editor
提交
da55a19a
Awesome-Markdown-Editor
项目概览
Richard 祝发兴 - -IT
/
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,发现更多精彩内容 >>
提交
da55a19a
编写于
7月 08, 2022
作者:
璃白.
🌻
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
✨
添加es module引用方式
上级
4923eaac
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
17 deletion
+26
-17
src/main.js
src/main.js
+18
-15
webpack.config.js
webpack.config.js
+8
-2
未找到文件。
src/main.js
浏览文件 @
da55a19a
...
@@ -4,9 +4,10 @@ import Vtip from "vtip";
...
@@ -4,9 +4,10 @@ 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/style/code/lightfair.less
"
;
Vue
.
use
(
Vtip
.
directive
);
Vue
.
use
(
Vtip
.
directive
);
function
initMdEditor
(
obj
)
{
const
initMdEditor
=
function
(
obj
)
{
const
_this
=
this
;
const
_this
=
this
;
this
.
value
=
{
this
.
value
=
{
text
:
""
,
text
:
""
,
...
@@ -110,7 +111,7 @@ function initMdEditor(obj) {
...
@@ -110,7 +111,7 @@ function initMdEditor(obj) {
onSubmit
(
val
);
onSubmit
(
val
);
},
},
upload
({
val
,
type
,
callback
})
{
upload
({
val
,
type
,
callback
})
{
onUpload
(
val
,
type
,
function
(
res
)
{
onUpload
(
val
,
type
,
function
(
res
)
{
callback
({
callback
({
url
:
res
,
url
:
res
,
file
:
val
file
:
val
...
@@ -119,13 +120,13 @@ function initMdEditor(obj) {
...
@@ -119,13 +120,13 @@ function initMdEditor(obj) {
},
},
renderLinks
({
links
,
callback
})
{
renderLinks
({
links
,
callback
})
{
if
(
!
renderLinks
)
return
callback
(
links
);
if
(
!
renderLinks
)
return
callback
(
links
);
renderLinks
(
links
,
function
(
res
)
{
renderLinks
(
links
,
function
(
res
)
{
callback
(
res
);
callback
(
res
);
});
});
},
},
queryUserList
({
keyWord
,
callback
})
{
queryUserList
({
keyWord
,
callback
})
{
if
(
!
queryUserList
)
return
callback
(
false
);
// 返回false则不触发@弹窗
if
(
!
queryUserList
)
return
callback
(
false
);
// 返回false则不触发@弹窗
queryUserList
(
keyWord
,
function
(
res
)
{
queryUserList
(
keyWord
,
function
(
res
)
{
const
list
=
res
;
const
list
=
res
;
if
(
!
keyWord
)
return
callback
(
list
);
if
(
!
keyWord
)
return
callback
(
list
);
callback
(
callback
(
...
@@ -144,18 +145,18 @@ function initMdEditor(obj) {
...
@@ -144,18 +145,18 @@ function initMdEditor(obj) {
})
})
}).
$mount
(
el
);
}).
$mount
(
el
);
this
.
getVideoList
=
function
(
callback
)
{
this
.
getVideoList
=
function
(
callback
)
{
return
this
.
vEl
.
$children
[
0
].
getVideoList
(
callback
);
return
this
.
vEl
.
$children
[
0
].
getVideoList
(
callback
);
};
};
this
.
getValue
=
function
(
callback
)
{
this
.
getValue
=
function
(
callback
)
{
if
(
callback
)
{
if
(
callback
)
{
callback
(
this
.
value
);
callback
(
this
.
value
);
}
}
return
this
.
value
;
return
this
.
value
;
};
};
this
.
setValue
=
function
(
val
)
{
this
.
setValue
=
function
(
val
)
{
props
.
value
=
(
val
||
""
)
+
""
;
props
.
value
=
(
val
||
""
)
+
""
;
this
.
vEl
.
$forceUpdate
();
this
.
vEl
.
$forceUpdate
();
if
(
!
props
.
setPreview
)
return
;
if
(
!
props
.
setPreview
)
return
;
...
@@ -167,27 +168,27 @@ function initMdEditor(obj) {
...
@@ -167,27 +168,27 @@ function initMdEditor(obj) {
});
});
};
};
this
.
focus
=
function
()
{
this
.
focus
=
function
()
{
props
.
focus
=
true
;
props
.
focus
=
true
;
this
.
vEl
.
$forceUpdate
();
this
.
vEl
.
$forceUpdate
();
};
};
this
.
blur
=
function
()
{
this
.
blur
=
function
()
{
props
.
focus
=
false
;
props
.
focus
=
false
;
this
.
vEl
.
$forceUpdate
();
this
.
vEl
.
$forceUpdate
();
};
};
this
.
disable
=
function
()
{
this
.
disable
=
function
()
{
props
.
disabled
=
true
;
props
.
disabled
=
true
;
this
.
vEl
.
$forceUpdate
();
this
.
vEl
.
$forceUpdate
();
};
};
this
.
enable
=
function
()
{
this
.
enable
=
function
()
{
props
.
disabled
=
false
;
props
.
disabled
=
false
;
this
.
vEl
.
$forceUpdate
();
this
.
vEl
.
$forceUpdate
();
};
};
this
.
registerTools
=
function
(
option
)
{
this
.
registerTools
=
function
(
option
)
{
props
.
registerTools
=
[];
props
.
registerTools
=
[];
if
(
Array
.
isArray
(
option
))
{
if
(
Array
.
isArray
(
option
))
{
props
.
registerTools
.
push
(...
option
);
props
.
registerTools
.
push
(...
option
);
...
@@ -197,7 +198,7 @@ function initMdEditor(obj) {
...
@@ -197,7 +198,7 @@ function initMdEditor(obj) {
this
.
vEl
.
$forceUpdate
();
this
.
vEl
.
$forceUpdate
();
};
};
this
.
toggleTab
=
function
(
setPreview
)
{
this
.
toggleTab
=
function
(
setPreview
)
{
if
(
setPreview
!==
"
edit
"
&&
setPreview
!==
"
preview
"
)
{
if
(
setPreview
!==
"
edit
"
&&
setPreview
!==
"
preview
"
)
{
props
.
setPreview
=
!
props
.
setPreview
;
props
.
setPreview
=
!
props
.
setPreview
;
}
else
{
}
else
{
...
@@ -207,7 +208,7 @@ function initMdEditor(obj) {
...
@@ -207,7 +208,7 @@ function initMdEditor(obj) {
this
.
vEl
.
$forceUpdate
();
this
.
vEl
.
$forceUpdate
();
};
};
this
.
toggleFullScreen
=
function
(
setFullScreen
)
{
this
.
toggleFullScreen
=
function
(
setFullScreen
)
{
if
(
setFullScreen
===
undefined
)
{
if
(
setFullScreen
===
undefined
)
{
props
.
setFullScreen
=
!
props
.
setFullScreen
;
props
.
setFullScreen
=
!
props
.
setFullScreen
;
}
else
{
}
else
{
...
@@ -215,6 +216,8 @@ function initMdEditor(obj) {
...
@@ -215,6 +216,8 @@ function initMdEditor(obj) {
}
}
this
.
vEl
.
$forceUpdate
();
this
.
vEl
.
$forceUpdate
();
};
};
}
}
;
window
.
MdEditor
=
initMdEditor
;
window
.
MdEditor
=
initMdEditor
;
export
default
initMdEditor
;
webpack.config.js
浏览文件 @
da55a19a
...
@@ -2,14 +2,20 @@ const path = require("path");
...
@@ -2,14 +2,20 @@ const path = require("path");
const
VueLoaderPlugin
=
require
(
"
vue-loader/lib/plugin
"
);
const
VueLoaderPlugin
=
require
(
"
vue-loader/lib/plugin
"
);
module
.
exports
=
{
module
.
exports
=
{
entry
:
path
.
resolve
(
__dirname
,
"
./src/main.js
"
),
entry
:
path
.
resolve
(
__dirname
,
"
./src/main.js
"
),
experiments
:
{
outputModule
:
true
},
output
:
{
output
:
{
filename
:
"
markdown-editor.js
"
,
filename
:
"
markdown-editor.js
"
,
path
:
path
.
resolve
(
__dirname
,
"
public
"
)
path
:
path
.
resolve
(
__dirname
,
"
public
"
),
library
:
{
type
:
"
module
"
}
},
},
devServer
:
{
devServer
:
{
contentBase
:
path
.
resolve
(
__dirname
,
"
public
"
),
contentBase
:
path
.
resolve
(
__dirname
,
"
public
"
),
host
:
"
0.0.0.0
"
,
host
:
"
0.0.0.0
"
,
port
:
'
80
'
,
port
:
"
80
"
,
// port: 443,
// port: 443,
// https: true,
// https: true,
open
:
true
open
:
true
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录