Skip to content
Snippets Groups Projects
Commit e0902df7 authored by Thomas Fritsch's avatar Thomas Fritsch
Browse files

A.2. Extensions de VSCodium

parent b832b9ab
No related branches found
No related tags found
No related merge requests found
{
"singleQuote": true,
"trailingComma": "es5",
"endOfLine": "lf",
"useTabs": true
}
{
"[javascript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
......@@ -4,44 +4,45 @@ const data = [
base: 'tomate',
prix_petite: 6.5,
prix_grande: 9.95,
image: 'https://images.unsplash.com/photo-1532246420286-127bcd803104?fit=crop&w=500&h=300'
image:
'https://images.unsplash.com/photo-1532246420286-127bcd803104?fit=crop&w=500&h=300',
},
{
nom: 'Napolitaine',
base: 'tomate',
prix_petite: 6.5,
prix_grande: 8.95,
image: 'https://images.unsplash.com/photo-1562707666-0ef112b353e0?&fit=crop&w=500&h=300'
image:
'https://images.unsplash.com/photo-1562707666-0ef112b353e0?&fit=crop&w=500&h=300',
},
{
nom: 'Spicy',
base: 'crème',
prix_petite: 5.5,
prix_grande: 8,
image: 'https://images.unsplash.com/photo-1458642849426-cfb724f15ef7?fit=crop&w=500&h=300'
}
image:
'https://images.unsplash.com/photo-1458642849426-cfb724f15ef7?fit=crop&w=500&h=300',
},
];
class Component {
tag;
children;
constructor( tag, children ){
constructor(tag, children) {
this.tag = tag;
this.children = children;
}
render() {
return `<${this.tag} ${
this.children ?
`>${this.children}</${this.tag}>` :
' />'
this.children ? `>${this.children}</${this.tag}>` : ' />'
}`;
}
}
const title = new Component( 'h1', 'La carte' );
const title = new Component('h1', 'La carte');
document.querySelector('.pageTitle').innerHTML = title.render();
const img = new Component( 'img' );
document.querySelector( '.pizzasContainer' ).innerHTML = img.render();
\ No newline at end of file
const img = new Component('img');
document.querySelector('.pizzasContainer').innerHTML = img.render();
......@@ -2796,6 +2796,12 @@
"dev": true,
"optional": true
},
"prettier": {
"version": "1.19.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz",
"integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==",
"dev": true
},
"private": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment