We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 623d7fa commit a43ae78Copy full SHA for a43ae78
front-end/h5/src/components/core/models/element.js
@@ -27,8 +27,8 @@ class Element {
27
* 3. 为何需要 clone,因为会有 element.clone() 以及 page.clone(),
28
* element.pluginProps 和 elementcommonStyle 是引用类型,如果不做 deep_clone 可能会出现意外错误
29
*/
30
- this.pluginProps = clone(ele.pluginProps) || this.getDefaultPluginProps(ele.editorConfig || {})
31
- this.commonStyle = clone(ele.commonStyle) || this.getDefaultCommonStyle()
+ this.pluginProps = (typeof ele.pluginProps === 'object' && clone(ele.pluginProps)) || this.getDefaultPluginProps(ele.editorConfig || {})
+ this.commonStyle = (typeof ele.commonStyle === 'object' && clone(ele.commonStyle)) || this.getDefaultCommonStyle()
32
this.events = []
33
}
34
0 commit comments