handle images
This commit is contained in:
@@ -3,9 +3,10 @@
|
|||||||
# Samples:
|
# Samples:
|
||||||
|
|
||||||
* [French Departments](https://klemek.github.io/memory-helper-v2/?url=https%3A%2F%2Fklemek.github.io%2Fmemory-helper-v2%2Fsamples%2Ffrench_departments.csv&title=Départements+Français)
|
* [French Departments](https://klemek.github.io/memory-helper-v2/?url=https%3A%2F%2Fklemek.github.io%2Fmemory-helper-v2%2Fsamples%2Ffrench_departments.csv&title=Départements+Français)
|
||||||
|
* [French Departments w/ location](https://klemek.github.io/memory-helper-v2/?url=https%3A%2F%2Fklemek.github.io%2Fmemory-helper-v2%2Fsamples%2Ffrench_departments_w_location.csv&title=Départements+Français)
|
||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
[ ] readme
|
[] readme
|
||||||
[ ] handle images
|
[x] handle images
|
||||||
[ ] save modes
|
[] save modes
|
||||||
[ ] remove empty values from available data
|
[] remove empty values from available data
|
||||||
+2
-2
@@ -21,9 +21,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="currentItem">
|
<div v-else-if="currentItem">
|
||||||
<div class="main"><span id="question">{{ columns[mode] }} : {{ currentItem[mode] }}</span></div>
|
<div class="main"><span id="question" v-html="getFormatedData(mode)"></span></div>
|
||||||
<template v-if="showAnswer" v-for="(column, i) in columns">
|
<template v-if="showAnswer" v-for="(column, i) in columns">
|
||||||
<div v-if="i !== mode" class="main"><span id="answer">{{ column }} : {{ currentItem[i] }}</span></div>
|
<div v-if="i !== mode" class="main"><span id="answer" v-html="getFormatedData(i)"></span></div>
|
||||||
</template>
|
</template>
|
||||||
<div class="button-container">
|
<div class="button-container">
|
||||||
<div type="button" class="button long" v-if="!showAnswer" v-on:click="show">Show</div>
|
<div type="button" class="button long" v-if="!showAnswer" v-on:click="show">Show</div>
|
||||||
|
|||||||
@@ -83,6 +83,12 @@ let app = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getFormatedData(i) {
|
||||||
|
if (this.currentItem[i].startsWith('data:')) {
|
||||||
|
return this.columns[i] + ' :<br><img src="' + this.currentItem[i] + '" />';
|
||||||
|
}
|
||||||
|
return this.columns[i] + ' : ' + this.currentItem[i];
|
||||||
|
},
|
||||||
showApp() {
|
showApp() {
|
||||||
document.getElementById('app').setAttribute('style', '');
|
document.getElementById('app').setAttribute('style', '');
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user