Skip to content
This repository was archived by the owner on Apr 1, 2022. It is now read-only.

Commit 54a5932

Browse files
author
Ken Berkeley
committed
[improve] add view source button to examples
1 parent d8548c3 commit 54a5932

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

examples/dist/client.1c2f3b75.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/dist/client.460cfb9a.js

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

examples/dist/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212

1313
<script src="//cdn.bootcss.com/jquery/2.1.4/jquery.min.js"></script>
1414
<script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
15-
<script type="text/javascript" src="client.1c2f3b75.js"></script></body>
15+
<script type="text/javascript" src="client.460cfb9a.js"></script></body>
1616
</html>

examples/src/App.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
<fixed v-if="showTab === 'fixed'" />
5555
</div>
5656
</div>
57+
<hr />
58+
<button class="btn btn-default btn-block" @click="viewSource">
59+
<i class="fa fa-code"></i> &nbsp; View Source
60+
</button>
5761
</div>
5862

5963
<footer>
@@ -65,6 +69,7 @@
6569
import Basic from './Basic/'
6670
import Advanced from './Advanced/'
6771
import Fixed from './Fixed/'
72+
import capitalize from 'lodash/capitalize'
6873
const getCurHash = () => location.hash.replace(/^#/, '')
6974
7075
export default {
@@ -77,6 +82,11 @@ export default {
7782
this.showTab = getCurHash()
7883
console.clear()
7984
})
85+
},
86+
methods: {
87+
viewSource () {
88+
window.open(`https://github.com/OneWayTech/vue2-datatable/blob/master/examples/src/${capitalize(this.showTab)}/index.vue`)
89+
}
8090
}
8191
}
8292
</script>

0 commit comments

Comments
 (0)