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