Skip to content

Commit 89a14ca

Browse files
committed
made single row selectable, id copied on select
1 parent d99ad7c commit 89a14ca

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed

package-lock.json

+41
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"v-calendar": "^1.0.0-beta.22",
2323
"vue": "^2.6.10",
2424
"vue-axios": "^2.1.5",
25+
"vue-clipboard2": "^0.3.1",
2526
"vue-router": "^3.0.3",
2627
"vuex": "^3.0.1"
2728
},

src/components/Trophies.vue

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
striped
55
hover
66
responsive
7+
selectable
8+
select-mode="single"
9+
@row-selected="handleSelectRow"
710
:fields="fields"
811
:items="kills"
912
:filter="filters"
@@ -255,6 +258,9 @@ export default {
255258
clearDate: function(field) {
256259
Vue.set(this.filters, field, { start: null, end: null });
257260
},
261+
handleSelectRow: function(rows) {
262+
this.$copyText(rows[0].id.text);
263+
},
258264
handleDateShow: function(field) {
259265
let start = this.filters[field].start;
260266
let end = this.filters[field].end;

src/main.js

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
2727
import "typeface-press-start-2p";
2828
import VCalendar from "v-calendar";
29+
import VueClipboard from "vue-clipboard2";
2930

3031
library.add(
3132
faCrosshairs,
@@ -45,6 +46,7 @@ Vue.component("font-awesome-icon", FontAwesomeIcon);
4546

4647
Vue.use(VueAxios, axios);
4748
Vue.use(VCalendar);
49+
Vue.use(VueClipboard);
4850

4951
Vue.config.productionTip = false;
5052

0 commit comments

Comments
 (0)