|
| 1 | +<template> |
| 2 | + <div id="app"> |
| 3 | + <section class="section-hero"> |
| 4 | + <div class="grid-hero container grid-lg text-center"> |
| 5 | + <img src="./assets/logo.png"> |
| 6 | + <h1><vue-tiny-pagination /></h1> |
| 7 | + <h2>a Vue component for create a <u>tiny</u> pagination</h2> |
| 8 | + <p class="text-gray"> |
| 9 | + <a href="https://github.com/coderdiaz/vue-tiny-pagination" target="_blank">GitHub</a> | Latest version: <span class="version">0.1.0</span> |
| 10 | + </p> |
| 11 | + </div> |
| 12 | + </section> |
| 13 | + <section class="section-features bg-primary text-center"> |
| 14 | + <div class="container grid-lg"> |
| 15 | + <h2>Introduction</h2> |
| 16 | + <div class="columns"> |
| 17 | + <div class="column col-10 col-sm-12 col-mx-auto"> |
| 18 | + <p class="text-secondary"> |
| 19 | + This component provides a basic styles for pagination and a minimalistic design. This pagination can be used for paginate tables, data lists, etc. |
| 20 | + </p> |
| 21 | + </div> |
| 22 | + </div> |
| 23 | + </div> |
| 24 | + </section> |
| 25 | + <section class="section-usage bg-gray"> |
| 26 | + <div class="container grid-lg"> |
| 27 | + <h2>Installation</h2> |
| 28 | + <p class="h5">Install with NPM</p> |
| 29 | + <pre class="code" data-lang="Bash"><code><span class="tag">$</span>npm install <span class="atv">vue-tiny-pagination</span> --save</code></pre> |
| 30 | + <p class="h5">Install with Yarn</p> |
| 31 | + <pre class="code" data-lang="Bash"><code><span class="tag">$</span>yarn add <span class="atv">vue-tiny-pagination</span></code></pre> |
| 32 | + <p class="h5">Install with Bower</p> |
| 33 | + <pre class="code" data-lang="Bash"><code><span class="tag">$</span>bower install <span class="atv">vue-tiny-pagination</span></code></pre> |
| 34 | + <br> |
| 35 | + <h2>Basic usage</h2> |
| 36 | + <pre class="code" data-lang="HTML"><code><<span class="tag">div</span> id=<span class="atv">"app"</span>> |
| 37 | + <<span class="tag">tiny-pagination</span>> |
| 38 | + <span class="tag">:total</span>=<span class="atv">"total"</span> |
| 39 | + <span class="tag">@tiny:change-page</span>=<span class="atv">"changePage"</span>></<span class="tag">tiny-pagination</span>> |
| 40 | +</<span class="tag">div</span>></code></pre> |
| 41 | + <pre class="code" data-lang="Javascript"><code><span class="tag">import</span> Vue <span class="tag">from</span> <span class="atv">'vue'</span> |
| 42 | +<span class="tag">import</span> TinyPagination <span class="tag">from</span> <span class="atv">'vue-tiny-pagination'</span> |
| 43 | + |
| 44 | +<span class="tag">new</span> <span class="tag">Vue</span>({ |
| 45 | + <span class="tag">el</span>: <span class="atv">'#app'</span>, |
| 46 | + <span class="tag">data ()</span> { |
| 47 | + <span class="tag">return</span> { |
| 48 | + total: <span class="atv">100</span>, |
| 49 | + currentPage: <span class="atv">1</span> |
| 50 | + } |
| 51 | + }, |
| 52 | + <span class="tag">methods</span>: { |
| 53 | + <span class="tag">changePage</span> (pagination) { |
| 54 | + console.log(pagination.page) |
| 55 | + } |
| 56 | + }, |
| 57 | + <span class="tag">components</span>: { |
| 58 | + TinyPagination |
| 59 | + } |
| 60 | +})</code></pre> |
| 61 | + <br> |
| 62 | + <h2>Example</h2> |
| 63 | + <div class="pagination centered bg-primary"> |
| 64 | + <tiny-pagination |
| 65 | + :total="currentTotal" |
| 66 | + custom-class="custom-tiny-class" |
| 67 | + @tiny:change-page="changePage"></tiny-pagination> |
| 68 | + </div> |
| 69 | + <br> |
| 70 | + <kbd>Current page: {{currentPage}}</kbd> |
| 71 | + <br><br> |
| 72 | + <kbd>Total items: {{currentTotal}}</kbd> |
| 73 | + <br> |
| 74 | + <br> |
| 75 | + <h2>Documentation</h2> |
| 76 | + <h5>Props</h5> |
| 77 | + <table class="table table-stripe"> |
| 78 | + <thead> |
| 79 | + <tr> |
| 80 | + <th>Prop</th> |
| 81 | + <th>Type</th> |
| 82 | + <th>Default</th> |
| 83 | + <th>Description</th> |
| 84 | + </tr> |
| 85 | + </thead> |
| 86 | + <tbody> |
| 87 | + <tr> |
| 88 | + <td>total <i>(required)</i></td> |
| 89 | + <td>Number</td> |
| 90 | + <td>-</td> |
| 91 | + <td>A number of total items.</td> |
| 92 | + </tr> |
| 93 | + <tr> |
| 94 | + <td>page</td> |
| 95 | + <td>Number</td> |
| 96 | + <td>1</td> |
| 97 | + <td>A number for set a default page.</td> |
| 98 | + </tr> |
| 99 | + <tr> |
| 100 | + <td>lang</td> |
| 101 | + <td>String</td> |
| 102 | + <td>en</td> |
| 103 | + <td>Default language to show (<i>Available: en, es</i>).</td> |
| 104 | + </tr> |
| 105 | + <tr> |
| 106 | + <td>customClass</td> |
| 107 | + <td>String</td> |
| 108 | + <td></td> |
| 109 | + <td>A prop for set a custom class.</td> |
| 110 | + </tr> |
| 111 | + </tbody> |
| 112 | + </table> |
| 113 | + <br> |
| 114 | + <h5>Events</h5> |
| 115 | + <table class="table table-stripe"> |
| 116 | + <thead> |
| 117 | + <tr> |
| 118 | + <th>Event</th> |
| 119 | + <th>Description</th> |
| 120 | + </tr> |
| 121 | + </thead> |
| 122 | + <tbody> |
| 123 | + <tr> |
| 124 | + <td>tiny:change-page</td> |
| 125 | + <td>Get the current page from pagination <code>payload: {page: 1}</code>.</td> |
| 126 | + </tr> |
| 127 | + </tbody> |
| 128 | + </table> |
| 129 | + <br> |
| 130 | + <br> |
| 131 | + <div class="divider text-center" data-content="WHAT'S NEW"></div> |
| 132 | + <br> |
| 133 | + <div class="timeline"> |
| 134 | + <div class="timeline-item" id="timeline-example-1"> |
| 135 | + <div class="timeline-left"> |
| 136 | + <a href="#timeline-example-1" class="timeline-icon tooltip" data-tooltip="March 2016"></a> |
| 137 | + </div> |
| 138 | + <div class="timeline-content"> |
| 139 | + <div class="tile"> |
| 140 | + <div class="tile-content"> |
| 141 | + <p class="tile-subtitle">February 10, 2017</p> |
| 142 | + <p class="tile-title">Initial commit and first release.</p> |
| 143 | + </div> |
| 144 | + </div> |
| 145 | + </div> |
| 146 | + </div> |
| 147 | + </div> |
| 148 | + </div> |
| 149 | + </section> |
| 150 | + <footer class="section-footer"> |
| 151 | + <div class="grid-footer container grid-lg"> |
| 152 | + <p><a href="https://dribbble.com/coderdiaz" target="_blank">Dribbble</a> | <a href="https://github.com/coderdiaz/vue-tiny-pagination" target="_blank">GitHub</a> | Version <span class="version">0.1.0</span></p> |
| 153 | + <p>Designed and built with <span class="text-error">♥</span> by <a href="https://twitter.com/coderdiaz" target="_blank">Javier Diaz</a>. Licensed under the <a href="https://github.com/coderdiaz/vue-tiny-pagination/blob/master/LICENSE" target="_blank">MIT License</a>.</p> |
| 154 | + </div> |
| 155 | + </footer> |
| 156 | + </div> |
| 157 | +</template> |
| 158 | + |
| 159 | +<script> |
| 160 | +import TinyPagination from "./components/TinyPagination"; |
| 161 | +export default { |
| 162 | + name: "app", |
| 163 | + data() { |
| 164 | + return { |
| 165 | + currentTotal: 100, |
| 166 | + currentPage: 1, |
| 167 | + message: "A Vue component for create tiny pagination" |
| 168 | + }; |
| 169 | + }, |
| 170 | + methods: { |
| 171 | + changePage(pagination) { |
| 172 | + this.currentPage = pagination.page |
| 173 | + } |
| 174 | + }, |
| 175 | + components: { |
| 176 | + TinyPagination |
| 177 | + } |
| 178 | +}; |
| 179 | +</script> |
| 180 | + |
| 181 | +<style lang="scss" src="./_scss/main.scss"></style> |
0 commit comments