mirror of https://github.com/artf/grapesjs.git
2 changed files with 32 additions and 21 deletions
@ -1,21 +0,0 @@ |
|||
import ComponentTextNode from './ComponentTextNode'; |
|||
|
|||
export default class ComponentComment extends ComponentTextNode { |
|||
get defaults() { |
|||
return { ...super.defaults }; |
|||
} |
|||
|
|||
toHTML() { |
|||
return `<!--${this.get('content')}-->`; |
|||
} |
|||
} |
|||
|
|||
ComponentComment.isComponent = el => { |
|||
if (el.nodeType == 8) { |
|||
return { |
|||
tagName: 'NULL', |
|||
type: 'comment', |
|||
content: el.textContent, |
|||
}; |
|||
} |
|||
}; |
|||
@ -0,0 +1,32 @@ |
|||
import ComponentTextNode from './ComponentTextNode'; |
|||
|
|||
export default class ComponentComment extends ComponentTextNode { |
|||
get defaults() { |
|||
// @ts-ignore
|
|||
return { ...super.defaults }; |
|||
} |
|||
|
|||
toHTML() { |
|||
return `<!--${this.get('content')}-->`; |
|||
} |
|||
|
|||
static isComponent(el: HTMLElement) { |
|||
if (el.nodeType == 8) { |
|||
return { |
|||
tagName: 'NULL', |
|||
type: 'comment', |
|||
content: el.textContent, |
|||
}; |
|||
} |
|||
} |
|||
} |
|||
|
|||
// ComponentComment.isComponent = el => {
|
|||
// if (el.nodeType == 8) {
|
|||
// return {
|
|||
// tagName: 'NULL',
|
|||
// type: 'comment',
|
|||
// content: el.textContent,
|
|||
// };
|
|||
// }
|
|||
// };
|
|||
Loading…
Reference in new issue