archiv | Zobrazovat TreeNode u cisel v archvu.

This commit is contained in:
Tomas "Jethro" Pokorny 2020-11-04 00:56:20 +01:00
parent e98a0590b7
commit aa19d67e20
3 changed files with 20 additions and 1 deletions

View file

@ -1,4 +1,5 @@
{% extends "seminar/archiv/base.html" %} {% extends "seminar/archiv/base.html" %}
{% load render_bundle from webpack_loader %}
{% block content %} {% block content %}
<div> <div>
@ -48,6 +49,14 @@
</div> </div>
{% endif %} {% endif %}
<script id="vuedata" type="application/json">{"treenode":{{cislo.cislonode.id}}}</script>
<div id="app">
<app></app>
</div>
{% render_bundle 'chunk-vendors' %}
{% render_bundle 'vue_app_01' %}
{% if cislo.verejna_vysledkovka %} {% if cislo.verejna_vysledkovka %}
<h2>Výsledkovka</h2> <h2>Výsledkovka</h2>

View file

@ -31,10 +31,15 @@ export default {
}), }),
props:{ props:{
tnid: Number, tnid: Number,
tnsource: String,
editorMode: Boolean, editorMode: Boolean,
debugMode: Boolean, debugMode: Boolean,
}, },
mounted: function() { mounted: function() {
if (this.tnsource && this.tnsource=='inline'){
let data = JSON.parse(document.getElementById('vuedata').textContent);
this.tnid = data.treenode;
}
this.getArticles(); this.getArticles();
this.$root.$on('updateData',(arg) => { this.$root.$on('updateData',(arg) => {
console.log(arg); console.log(arg);

View file

@ -22,7 +22,12 @@ export default new Router({
name: 'treenode_zadani', name: 'treenode_zadani',
props: {'tnid': 23}, props: {'tnid': 23},
component: TreeNodeRoot component: TreeNodeRoot
}, }, {
path: '/cislo/:cislo',
name: 'treenode_cislo',
props: {'tnsource':'inline'},
component: TreeNodeRoot
}
] ]
}) })