Skip to content
Snippets Groups Projects
Select Git revision
  • adf0442910025e921110643543289d82a80c5253
  • master default protected
2 results

Component.js

Blame
  • Forked from an inaccessible project.
    Component.js 404 B
    export default class Component{
    	tagName;
    	attribute;
    	children;
    	constructor( tagName, attribute, children ) {
    		this.tagName=tagName
    		this.children=children;
    		this.attribute=attribute;
    	}
    	render(){
    		if(this.tagName == 'img'){
    			return `<${this.tagName} ${this.attribute.name}='${this.attribute.value}' ${this.children} />	`;
    		}
    		return `<${this.tagName}>${this.children}</${this.tagName}>`;
    	}
    }