add query params to remember opened texts & define what component to append based on those query

This commit is contained in:
axolotle
2021-03-08 16:07:12 +01:00
parent 9a0d07b0f1
commit 973b191eaf
3 changed files with 54 additions and 12 deletions
+5 -1
View File
@@ -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)