- {{ text }}
+
+ Biblio
+
@@ -10,14 +12,11 @@ export default {
data () {
return {
- text: null
+ query: {
+ mode: 'card-list',
+ texts: [[1, 10, 2], [20, 5, 19]]
+ }
}
- },
-
- created () {
- this.$store.dispatch('GET_TEXT', { id: 1 }).then(data => {
- this.text = data.textref
- })
}
}
diff --git a/src/router/routes.js b/src/router/routes.js
index 72d9850..762f819 100644
--- a/src/router/routes.js
+++ b/src/router/routes.js
@@ -17,7 +17,11 @@ export default [
},
props: {
default: ({ query }) => ({
- mode: query.mode || 'tree-map'
+ mode: query.mode || 'tree-map',
+ // In case of a reload or direct link, vue-router doesn't turn the query string into an array.
+ texts: query.texts && query.texts.length && typeof query.texts[0] === 'string'
+ ? query.texts.map(text => text.split(',').map(id => parseInt(id)))
+ : query.texts
}),
options: ({ query }) => ({
show: !('texts' in query)