github.com/v2pro/plz@v0.0.0-20221028024117-e5f9aec5b631/witch/webroot/viz-struct.html (about) 1 <script type="text/x-template" id="viz-struct-template"> 2 <table> 3 <tr> 4 <td v-for="(value, field) in data" :key="field"> 5 <div>{{ field }}</div> 6 <viz-value :data="value" :path="path + ' > ' + field" 7 @showPtr="showPtr" @hidePtr="hidePtr"/> 8 </td> 9 </tr> 10 </table> 11 </script> 12 <script> 13 Vue.component('viz-struct', { 14 template: '#viz-struct-template', 15 props: ['data','path'], 16 methods: { 17 showPtr: function (e) { 18 this.$emit('showPtr', e); 19 }, 20 hidePtr: function (e) { 21 this.$emit('hidePtr', e); 22 } 23 } 24 }); 25 </script>