Skip to content

Commit e37829e

Browse files
author
Santiago Aguilar Hernández
authored
Merge pull request #12 from feload/master
Add v-html directive to template.ts in order to render raw HTML.
2 parents 005fb97 + 062f5da commit e37829e

File tree

9 files changed

+443
-5
lines changed

9 files changed

+443
-5
lines changed

demo/commonjs/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ <h4>Default</h4>
2020

2121
<div is="uib-pagination" :direction-links="false" :total-items="totalItems" v-model="pagination1"></div>
2222

23+
<h6><code>page-label</code> returning <code>raw html</code>:</h6>
24+
<div is="uib-pagination" :direction-links="false" :total-items="totalItems" v-model="pagination1" :page-label="pageLabelHtml"></div>
25+
2326
<pre>The selected page no: {{pagination1.currentPage}}</pre>
2427

2528
<button type="button" class="btn btn-info" @click="setPage(3)">Set current page to: 3</button>
@@ -44,6 +47,7 @@ <h6><code>boundary-link-numbers</code> set to <code>true</code> and <code>rotate
4447
<uib-pagination :total-items="bigTotalItems" v-model="pagination2" :max-size="maxSize" class="pagination-sm" :boundary-link-numbers="true" :rotate="false"></uib-pagination>
4548

4649
<pre>Page: {{pagination2.currentPage}} / {{pagination2.numPages}}</pre>
50+
4751
</div>
4852

4953
<script src="dist/main.js"></script>

demo/commonjs/src/main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ var app = new Vue({
1414
this.pagination1.currentPage = pageNo;
1515
},
1616

17+
pageLabelHtml: function (pageNo) {
18+
return `<b>${pageNo}</b>`;
19+
},
20+
1721
pageChanged: function() {
1822
console.log('Page changed to: ' + this.pagination1.currentPage);
1923
},

demo/es6/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ <h4>Default</h4>
2020

2121
<div is="uib-pagination" :direction-links="false" :total-items="totalItems" v-model="pagination1"></div>
2222

23+
<h6><code>page-label</code> returning <code>raw html</code>:</h6>
24+
<div is="uib-pagination" :direction-links="false" :total-items="totalItems" v-model="pagination1" :page-label="pageLabelHtml"></div>
25+
2326
<pre>The selected page no: {{pagination1.currentPage}}</pre>
2427

2528
<button type="button" class="btn btn-info" @click="setPage(3)">Set current page to: 3</button>
@@ -49,4 +52,4 @@ <h6><code>boundary-link-numbers</code> set to <code>true</code> and <code>rotate
4952
<script src="dist/main.js"></script>
5053
</body>
5154

52-
</html>
55+
</html>

demo/es6/src/main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ var app = new Vue({
1414
this.pagination1.currentPage = pageNo;
1515
},
1616

17+
pageLabelHtml: function (pageNo) {
18+
return `<b>${pageNo}</b>`;
19+
},
20+
1721
pageChanged: function () {
1822
console.log('Page changed to: ' + this.pagination1.currentPage);
1923
},

demo/global/dist/main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var app = new Vue({
22
el: "#app",
33
data: {
44
totalItems: 64,
5-
5+
66
pagination1: {
77
currentPage: 4
88
},
@@ -15,6 +15,10 @@ var app = new Vue({
1515
this.pagination1.currentPage = pageNo;
1616
},
1717

18+
pageLabelHtml: function (pageNo) {
19+
return `<b>${pageNo}</b>`;
20+
},
21+
1822
pageChanged: function () {
1923
console.log('Page changed to: ' + this.pagination1.currentPage);
2024
},

demo/global/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ <h4>Default</h4>
2020

2121
<div is="uib-pagination" :direction-links="false" :total-items="totalItems" v-model="pagination1"></div>
2222

23+
<h6><code>page-label</code> returning <code>raw html</code>:</h6>
24+
<div is="uib-pagination" :direction-links="false" :total-items="totalItems" v-model="pagination1" :page-label="pageLabelHtml"></div>
25+
2326
<pre>The selected page no: {{pagination1.currentPage}}</pre>
2427

2528
<button type="button" class="btn btn-info" @click="setPage(3)">Set current page to: 3</button>

dist/vuejs-uib-pagination.js

Lines changed: 417 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vuejs-uib-pagination.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/template/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</li>
88
<li role="menuitem" v-for="(page, index) in pages" :key="index" :class="{ active: page.active, disabled: disabled && !page.active }"
99
class="pagination-page">
10-
<a href @click="selectPage(page.number, $event)" :disabled="disabled && !page.active" v-uib-tabindex-toggle="disabled && !page.active">{{ page.text }}</a>
10+
<a href @click="selectPage(page.number, $event)" :disabled="disabled && !page.active" v-uib-tabindex-toggle="disabled && !page.active" v-html="page.text"></a>
1111
</li>
1212
<li role="menuitem" v-if="directionLinks" :class="{ disabled: isNoNextOrDisabled }" class="pagination-next">
1313
<a href @click="selectPage(currentPage + 1, $event)" :disabled="isNoNextOrDisabled" v-uib-tabindex-toggle="isNoNextOrDisabled">{{ getText('next') }}</a>

0 commit comments

Comments
 (0)