1 // Show a problem summary on variant page
2 Vue
.component('my-problem-summary', {
5 <div class="problem col-sm-12" @click="showProblem()">
6 <div class="diagram" v-html="getDiagram(prob.fen)"></div>
7 <div class="problem-instructions" v-html="prob.instructions.substr(0,32)"></div>
8 <div class="problem-time">{{ timestamp2date(prob.added) }}</div>
12 getDiagram: function(fen
) {
13 const fenParts
= fen
.split(" ");
15 position: fenParts
[0],
16 // No need for flags here
21 return getDate(new Date(ts
));
23 // Propagate "show problem" event to parent component (my-problems)
24 showProblem: function() {
25 this.$emit('show-problem');