Last active
February 2, 2017 11:00
-
-
Save roll/665bf8cb19e5ec9b4fef52320402807b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// It's a plain javascript file vue component | |
// It should work for tests with mocha + JSDom | |
export default { | |
props: ['table'], | |
template: ` | |
<div> | |
<table class="error"> | |
<thead> | |
<tr> | |
<th>Row</th> | |
<th>Col</th> | |
<th>Code</th> | |
<th>Message</th> | |
</tr> | |
</thead> | |
<tbody> | |
<tr v-for="error of table.errors"> | |
<td>{{ error['row-number'] || 'H' }}</td> | |
<td>{{ error['column-number'] || '-' }}</td> | |
<td>{{ error.code }}</td> | |
<td>{{ error.message }}</td> | |
</tr> | |
</tbody> | |
</table> | |
</div> | |
` | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
// It's a one-file vue component | |
// It should work for tests with mocha+karma+webpack | |
// https://vue-loader.vuejs.org/en/workflow/testing.html | |
export default { | |
props: ['table'], | |
} | |
</script> | |
<template> | |
<div> | |
<table class="error"> | |
<thead> | |
<tr> | |
<th>Row</th> | |
<th>Col</th> | |
<th>Code</th> | |
<th>Message</th> | |
</tr> | |
</thead> | |
<tbody> | |
<tr v-for="error of table.errors"> | |
<td>{{ error['row-number'] || 'H' }}</td> | |
<td>{{ error['column-number'] || '-' }}</td> | |
<td>{{ error.code }}</td> | |
<td>{{ error.message }}</td> | |
</tr> | |
</tbody> | |
</table> | |
</div> | |
</template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment