Merge pull request #13 from dkvirus/patch-1

添加 marked 自定义属性
This commit is contained in:
zhaoxuhui 2019-06-27 18:51:49 +08:00 committed by GitHub
commit dbd8846273
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,6 +54,12 @@ export default {
exportFileName: { // 默认导出文件名称
type: String,
default: '未命名文件'
},
markedOptions: {
type: Object,
default () {
return {};
}
}
},
data() {
@ -449,7 +455,8 @@ export default {
clearTimeout(this.timeoutId);
this.timeoutId = setTimeout(() => {
this.html = marked(this.value, {
sanitize: false
sanitize: false,
...this.markedOptions
});
}, 30)
this.indexLenth = this.value.split('\n').length;