Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BeMount
PersonalBlog
提交
11541bdf
P
PersonalBlog
项目概览
BeMount
/
PersonalBlog
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PersonalBlog
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
11541bdf
编写于
4月 15, 2020
作者:
BeMount
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(/markdown-editor): 新增markdow-editor页面
上级
93b58d88
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
40 addition
and
7 deletion
+40
-7
src/router/index.js
src/router/index.js
+0
-1
src/views/markdown-editor/markdown-editor.less
src/views/markdown-editor/markdown-editor.less
+8
-2
src/views/markdown-editor/markdown-editor.vue
src/views/markdown-editor/markdown-editor.vue
+32
-4
未找到文件。
src/router/index.js
浏览文件 @
11541bdf
...
...
@@ -20,7 +20,6 @@ const router = new VueRouter({
})
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
// console.log(to);
// 判断是否未登录就进入个人中心
to
.
matched
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
name
==
'
personalCenter
'
&&
localStorage
.
getItem
(
'
jwt
'
)
==
undefined
){
...
...
src/views/markdown-editor/markdown-editor.less
浏览文件 @
11541bdf
.margin-top-20{
margin-top:20px;
.editor{
width:100%;
.margin-top-20{
margin-top:20px;
.v-note-wrapper{
height:60vh;
}
}
}
\ No newline at end of file
src/views/markdown-editor/markdown-editor.vue
浏览文件 @
11541bdf
...
...
@@ -4,11 +4,24 @@
<
template
>
<div>
<div
class=
"editor"
>
<Row
class=
"margin-top-20"
>
<Col
span=
"24"
>
<Col
span=
"4"
offset=
'10'
style=
"text-align:center"
>
<span
style=
"font-size:16px;font-weight:bold"
><Icon
@
click=
"submitContent"
type=
"ios-cloud-upload-outline"
size=
'24'
style=
"margin-right:20px"
/>
发布文章
</span>
</Col>
<Col
span=
"24"
>
<!--
<p></p>
-->
<mavon-editor
v-model=
"markdownContent"
@
save=
"getHTMLCode"
/>
<mavon-editor
v-model =
"markdownContent"
@
save =
"getHTMLCode"
/>
</Col>
<Col
span=
"24"
style=
"margin-top:40px"
>
<Form
ref=
"articleForm"
:model=
"articleForm"
:label-width=
'100'
:rules=
"articleRules"
>
<FormItem
label =
"文章标题"
prop=
"articleTitle"
>
<Input
v-model=
"articleForm.articleTitle"
style=
"width:200px"
></Input>
</FormItem>
<FormItem
label =
"文章介绍"
prop=
"articleDescription"
>
<Input
v-model=
"articleForm.articleDescription"
maxlength=
"200"
show-word-limit
type=
"textarea"
placeholder=
"Enter something..."
style=
"width: 300px"
></Input>
</FormItem>
</Form>
</Col>
</Row>
</div>
...
...
@@ -20,12 +33,27 @@ export default {
name
:
'
markdown-editor
'
,
data
(){
return
{
markdownContent
:
''
markdownContent
:
''
,
articleForm
:{
articleTitle
:
''
,
articleDescription
:
''
},
articleRules
:{
articleTitle
:[
{
required
:
true
,
message
:
'
请填写文章标题
'
,
trigger
:
'
blur
'
}
],
articleDescription
:[
{
required
:
true
,
message
:
'
请填写文章描述
'
,
trigger
:
'
blur
'
}
]
}
}
},
methods
:{
getHTMLCode
(
f
,
s
){
console
.
log
(
f
,
s
);
},
submitContent
(){
console
.
log
(
'
hello, submit content
'
);
}
}
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录