-
-
Notifications
You must be signed in to change notification settings - Fork 163
/
Copy pathLicenseDropdown.vue
67 lines (66 loc) · 1.66 KB
/
LicenseDropdown.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<template>
<b-field class="license-dropdown">
<b-select
:placeholder="this.$t('stepper.DD.placeholder')"
:value="shortName"
@input="setCurrentLicense"
>
<option
v-for="license in licenseList"
:key="license"
:value="license"
>
{{ license }}
</option>
</b-select>
</b-field>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
name: 'SelectedLicenseDropdown',
data() {
return {
licenseList: [
'CC0 1.0',
'CC BY 4.0',
'CC BY-SA 4.0',
'CC BY-ND 4.0',
'CC BY-NC 4.0',
'CC BY-NC-SA 4.0',
'CC BY-NC-ND 4.0'
],
currentLicense: undefined
}
},
computed: {
...mapGetters(['shortName', 'fullName'])
},
methods: {
setCurrentLicense(currentLicense) {
this.$store.commit('updateAttributesFromShort', currentLicense)
this.$emit('input')
if (process.env.NODE_ENV === 'production') {
this.$ga.event({
eventCategory: 'LicenseDropdown',
eventAction: 'licenseSelected',
eventLabel: currentLicense
})
}
}
}
}
</script>
<style lang="scss">
.license-dropdown {
margin-top: 1rem;
.label{
font-weight: normal;
opacity: 0.8;
font-size: 1em;
}
.select, select {
width: 100%;
}
}
</style>