Skip to content

Instantly share code, notes, and snippets.

@victorwpbastos
Created December 26, 2016 20:13
Show Gist options
  • Save victorwpbastos/71955408eb85a129b23a8274ac659842 to your computer and use it in GitHub Desktop.
Save victorwpbastos/71955408eb85a129b23a8274ac659842 to your computer and use it in GitHub Desktop.
Vue Table Snippet
<snippet>
<content><![CDATA[
<table class="table table-bordered">
<thead>
<tr>${SELECTION/([^\s]+)|(?:\s(\w+))/()(?3\n\t\t\t<th class="text-center text-uppercase">$3<\/th>)/g}
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in ${SELECTION/([^\s]+)|(\s\w+)/$1/g}">${SELECTION/([^\s]+)|(\s(\w+))/()(?3\n\t\t\t<td class="text-center">{{ item\.$3 }}<\/td>)/g}
</tr>
</tbody>
</table>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>vtable</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
<description>Create Vue Table</description>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment