Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VueElementTemplate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HireTest
VueElementTemplate
Commits
5b3b8b87
Commit
5b3b8b87
authored
Oct 26, 2017
by
Pan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor:change MdEditor to MarkdownEditor
parent
2c82d0a2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
markdown.vue
src/views/components/markdown.vue
+14
-3
No files found.
src/views/components/markdown.vue
View file @
5b3b8b87
...
...
@@ -2,7 +2,7 @@
<div
class=
"components-container"
>
<code>
Markdown 我们这里选用了
<a
href=
"https://github.com/sparksuite/simplemde-markdown-editor"
target=
"_blank"
>
simplemde-markdown-editor
</a>
,简单的用vue封装了一下
<a
target=
'_blank'
href=
'https://segmentfault.com/a/1190000009762198#articleHeader14'
>
相关文章
</a></code>
<div
class=
"editor-container"
>
<m
d-editor
id=
'contentEditor'
ref=
"contentEditor"
v-model=
'content'
:height=
"300"
:zIndex=
'20'
></md
-editor>
<m
arkdown-editor
id=
'contentEditor'
ref=
"contentEditor"
v-model=
'content'
:height=
"300"
:zIndex=
'20'
></markdown
-editor>
</div>
<el-button
@
click=
'markdown2Html'
style=
"margin-top:80px;"
type=
"primary"
>
转为HTML
<i
class=
"el-icon-document el-icon--right"
></i></el-button>
<div
v-html=
"html"
></div>
...
...
@@ -10,16 +10,27 @@
</
template
>
<
script
>
import
M
d
Editor
from
'@/components/MarkdownEditor'
import
M
arkdown
Editor
from
'@/components/MarkdownEditor'
export
default
{
components
:
{
M
d
Editor
},
components
:
{
M
arkdown
Editor
},
data
()
{
return
{
content
:
'## Simplemde'
,
html
:
''
}
},
computed
:
{
cachedViews
()
{
return
this
.
$store
.
state
.
app
.
cachedViews
}
},
// deactivated() {
// console.log(this.cachedViews.indexOf(this.$route.name))
// if (this.cachedViews.indexOf(this.$route.name)
<
0
)
{
// this.$destroy()
// }
// },
methods
:
{
markdown2Html
()
{
import
(
'showdown'
).
then
(
showdown
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment