mirror of
https://github.com/vuejs/vue.git
synced 2024-11-22 04:39:46 +00:00
4f5a47d750
* fix root v-else not rendering in production and switched examples to minified vue for better prod coverage * add dev build comment to examples * convert tabs to spaces in todomvc example for consistency
53 lines
1.3 KiB
HTML
53 lines
1.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Vue.js grid component example</title>
|
|
<link rel="stylesheet" href="style.css">
|
|
<!-- Delete ".min" for console warnings in development -->
|
|
<script src="../../dist/vue.min.js"></script>
|
|
</head>
|
|
<body>
|
|
|
|
<!-- component template -->
|
|
<script type="text/x-template" id="grid-template">
|
|
<table v-if="filteredData.length">
|
|
<thead>
|
|
<tr>
|
|
<th v-for="key in columns"
|
|
@click="sortBy(key)"
|
|
:class="{ active: sortKey == key }">
|
|
{{ key | capitalize }}
|
|
<span class="arrow" :class="sortOrders[key] > 0 ? 'asc' : 'dsc'">
|
|
</span>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr v-for="entry in filteredData">
|
|
<td v-for="key in columns">
|
|
{{entry[key]}}
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p v-else>No matches found.</p>
|
|
</script>
|
|
|
|
<!-- demo root element -->
|
|
<div id="demo">
|
|
<form id="search">
|
|
Search <input name="query" v-model="searchQuery">
|
|
</form>
|
|
<demo-grid
|
|
:data="gridData"
|
|
:columns="gridColumns"
|
|
:filter-key="searchQuery">
|
|
</demo-grid>
|
|
</div>
|
|
|
|
<script src="grid.js"></script>
|
|
|
|
</body>
|
|
</html>
|