Add vue-simplemde replace vue-markdown

pull/38/head
lin-xin 2017-02-18 11:57:14 +08:00
parent 512566e990
commit f96ba1afac
2 changed files with 17 additions and 23 deletions

View File

@ -13,9 +13,9 @@
"element-ui": "^1.1.6", "element-ui": "^1.1.6",
"vue": "^2.1.10", "vue": "^2.1.10",
"vue-datasource": "^1.0.4", "vue-datasource": "^1.0.4",
"vue-markdown": "^2.1.3",
"vue-quill-editor": "^1.1.1", "vue-quill-editor": "^1.1.1",
"vue-router": "^2.2.0" "vue-router": "^2.2.0",
"vue-simplemde": "^0.3.2"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "^6.7.2", "autoprefixer": "^6.7.2",

View File

@ -7,39 +7,33 @@
</el-breadcrumb> </el-breadcrumb>
</div> </div>
<div class="plugins-tips"> <div class="plugins-tips">
vue-markdown一个基于vue.js的markdown语法解析插 Vue-SimpleMDEVue.js的Markdown Editor组
访问地址<a href="https://github.com/miaolz123/vue-markdown" target="_blank">vue-markdown</a> 访问地址<a href="https://github.com/F-loat/vue-simplemde" target="_blank">Vue-SimpleMDE</a>
</div> </div>
<textarea class="markdown-left" v-model="content"></textarea> <markdown-editor v-model="content" :configs="configs" ref="markdownEditor"></markdown-editor>
<vue-markdown class="markdown-right" :source="content"></vue-markdown>
</div> </div>
</template> </template>
<script> <script>
import VueMarkdown from 'vue-markdown'; import { markdownEditor } from 'vue-simplemde';
export default { export default {
data: function(){ data: function(){
return { return {
content:'# Hello BBK' content:'',
configs: {
status: false,
initialValue: 'Hello BBK',
renderingConfig: {
codeSyntaxHighlighting: true,
highlightingTheme: 'atom-one-light'
}
}
} }
}, },
components: { components: {
VueMarkdown markdownEditor
} }
} }
</script> </script>
<style scoped> <style></style>
.markdown-left,.markdown-right{
width:48%;
height: 700px;
float: left;
padding:10px;
box-sizing: border-box;
border: 1px solid #ddd;
overflow-y: scroll;
}
.markdown-right{
margin-left: 3%;
}
</style>