123456789101112131415161718192021222324 |
- class TrainingItem {
- constructor () {}
- static createElement(data){
- let d = document.createElement('div');
- d.innerHTML = Training.createHTMLString(data);
- return d.childNodes[0];
- }
- static createHTMLString(data){
- return `
- <div class="training-item-frame">
- <img src="${data.img}" alt="" />
- <div class="training-new" style="display:${data.isNew ? 'block' : 'none'};"></div>
- <div class="training-desc">
- <p class="subject">${data.subject}</p>
- <p class="subject-sub">${data.subjectSub}</p>
- </div>
- </div>
- `;
- }
- }
- module.exports = TrainingItem;
|