retour d'expérience sur la refonte site media
16 ans d'XP (aïe)
@rebolon
Dev
Full Stack
Back et Front
en PHP ou Java
avec
du jQuery
Refonte du site Euronews.com, le site d'une chaine d'information audio-visuelle
V1
V2
Text
stickyBars
newsBar
Caroussels
Sports Results
Client
Serveur Web PHP
Serveur Web NodeJs
Persistence
Cache
http
http
génère tout le DOM
^n
1 page = 1 appel http
let cpt = new Vue({
...
template: `{{name}}`,
data: function() {
return {
name: "rebolon"
}
}
});
cpt.name = "benjamin";
let cpt = new Vue({
...
props: {
name: {type: String, default: 'rebolon'}
}
});
...
<div id="demo">
<my-cpt v-bind:name="parentReactiveVar"></my-cpt>
</div>
<ul class="collection">
<li v-for="character in characters">
<img
v-bind:src="character.thumbnail.path + '.' + character.thumbnail.extension"
v-bind:alt="character.name">
<span class="title">{{character.name | uppercase }}</span>
</li>
</ul>
<script type="x/template" id="timeline-bar-template">
/* Your tpl here */
<div v-if="user">Hello {{user.name}} </div>
</script>
<div id="my-cpt">
{{ name }}
</div>
<div id="app">
<characters></characters>
</div>
<script type="x/template" id="characters-tpl">
<ul>
<li v-for="character in characters">
<div class="chip">
<img v-bind:src="character.thumbnail.path + '.' + character.thumbnail.extension">
{{character.name}}
</div>
</li>
</ul>
</script>
<script data-item="vuejs-component-characters">
Vue.component('characters', {
template: '#characters-tpl',
data: function () {
return {
characters: []
};
},
beforeCreate: function () {
this.$http
.get("https://gateway.marvel.com:443/v1/public/characters",
{params: {apikey: Rebolon.Marvel.apiKey}})
.then(response => {
try {
var characters = response.body.data.results;
characters.forEach(item => {
this.characters.push(item);
});
} catch (e) {
console.error('unexpected data', response);
}
}, response => {
console.warn('http error', response);
}
);
}
});
new Vue({el: 'app'});
</script>
<script type="x/template" id="timeline-bar-template">
<a href="{{ itemTimeline | timelineSlug }}"
data-component
v-for="itemTimeline in items | orderBy 'publishedAt' -1"
track-by="id"
id="timeline-1">
<div class="enw-justin__item">
...
...
...
ou
Participez via Patreon ou Github
Merci à @Aldebaran Robotics pour son robot