fix:修复initialValue为undefined时报错的问题
This commit is contained in:
parent
9ac3606f83
commit
952d702fff
1
.gitignore
vendored
1
.gitignore
vendored
@ -10,3 +10,4 @@ yarn-error.log
|
||||
*.njsproj
|
||||
*.sln
|
||||
/build/
|
||||
.vscode/
|
||||
|
5
.vscode/settings.json
vendored
Normal file
5
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"jumpToAliasFile.alias": {
|
||||
"vue$": "vue/dist/vue.esm.js"
|
||||
}
|
||||
}
|
@ -4,7 +4,6 @@
|
||||
|
||||
GitHub :[https://github.com/zhaoxuhui1122/vue-markdown]( https://github.com/zhaoxuhui1122/vue-markdown)
|
||||
|
||||
|
||||
### 1.简介
|
||||
|
||||
**一款使用marked和highlight.js开发的一款markdown编辑器,目前只支持在vue项目中使用。**
|
||||
|
2
dist/build.js
vendored
2
dist/build.js
vendored
File diff suppressed because one or more lines are too long
BIN
dist/build.js.gz
vendored
BIN
dist/build.js.gz
vendored
Binary file not shown.
2
dist/build.js.map
vendored
2
dist/build.js.map
vendored
File diff suppressed because one or more lines are too long
BIN
dist/build.js.map.gz
vendored
BIN
dist/build.js.map.gz
vendored
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "vue-meditor",
|
||||
"description": "一款使用marked和highlight.js开发的一款markdown编辑器",
|
||||
"version": "1.3.0",
|
||||
"version": "1.3.1",
|
||||
"author": "zhaoxuhui<1258835133@qq.com>",
|
||||
"license": "MIT",
|
||||
"main": "build/index.js",
|
||||
|
@ -39,6 +39,7 @@
|
||||
setTimeout(() => {
|
||||
this.initialValue = doc;
|
||||
}, 1000);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -4,7 +4,6 @@ export default `# vue-Markdown编辑器
|
||||
|
||||
GitHub :[https://github.com/zhaoxuhui1122/vue-markdown]( https://github.com/zhaoxuhui1122/vue-markdown)
|
||||
|
||||
|
||||
### 1.简介
|
||||
|
||||
**一款使用marked和highlight.js开发的一款markdown编辑器,目前只支持在vue项目中使用。**
|
||||
|
@ -24,7 +24,10 @@ marked.setOptions({
|
||||
export default {
|
||||
name: 'markdown',
|
||||
props: {
|
||||
initialValue: String, // 初始化内容
|
||||
initialValue: {
|
||||
type:String,
|
||||
default:''
|
||||
}, // 初始化内容
|
||||
theme: { // 默认主题
|
||||
type: String,
|
||||
default: 'Light'
|
||||
@ -412,7 +415,7 @@ export default {
|
||||
e.target.value = '';
|
||||
}
|
||||
},
|
||||
addImageClickLintener() { // 监听查看大图
|
||||
addImageClickListener() { // 监听查看大图
|
||||
const {
|
||||
imgs
|
||||
} = this;
|
||||
@ -465,7 +468,7 @@ export default {
|
||||
const height3 = this.$refs.preview.scrollHeight;
|
||||
this.scrollHeight = Math.max(height1, height2, height3);
|
||||
this.indexLenth = parseInt(this.scrollHeight / 22, 0) - 1;
|
||||
this.addImageClickLintener();
|
||||
this.addImageClickListener();
|
||||
},
|
||||
theme() {
|
||||
this.themeName = this.theme;
|
||||
|
Loading…
x
Reference in New Issue
Block a user