Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
admin-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pleroma
admin-fe
Commits
5b3b8b87
Commit
5b3b8b87
authored
7 years ago
by
Pan
Browse files
Options
Downloads
Patches
Plain Diff
refactor:change MdEditor to MarkdownEditor
parent
2c82d0a2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/views/components/markdown.vue
+14
-3
14 additions, 3 deletions
src/views/components/markdown.vue
with
14 additions
and
3 deletions
src/views/components/markdown.vue
+
14
−
3
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'
></m
d
-editor>
<m
arkdown
-editor
id=
'contentEditor'
ref=
"contentEditor"
v-model=
'content'
:height=
"300"
:zIndex=
'20'
></m
arkdown
-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
=>
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment