<template lang="pug">
div
- .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2
- label(for="prefixFilter") Type first letters...
- input#prefixFilter(v-model="curPrefix")
- .variant.col-sm-12.col-md-5.col-lg-4(
- v-for="(v,idx) in filteredVariants"
- :class="{'col-md-offset-1': idx%2==0, 'col-lg-offset-2': idx%2==0}"
- )
- router-link(:to="getLink(v.name)")
- h4.boxtitle.text-center {{ v.name }}
- p.description.text-center {{ st.tr(v.desc) }}
+ .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2
+ label(for="prefixFilter") Type first letters...
+ input#prefixFilter(v-model="curPrefix")
+ .variant.col-sm-12.col-md-5.col-lg-4(
+ v-for="(v,idx) in filteredVariants"
+ :class="{'col-md-offset-1': idx%2==0, 'col-lg-offset-2': idx%2==0}"
+ )
+ router-link(:to="getLink(v.name)")
+ h4.boxtitle.text-center {{ v.name }}
+ p.description.text-center {{ st.tr[v.desc] }}
</template>
<script>
name: "variants",
data: function() {
return {
- curPrefix: "",
+ curPrefix: "",
st: store.state,
};
- },
- computed: {
- filteredVariants: function () {
- const capitalizedPrefix = this.curPrefix.replace(/^\w/, c => c.toUpperCase());
- const variants = this.st.variants
- .filter( v => {
- return v.name.startsWith(capitalizedPrefix);
- })
- .map( v => {
- return {
- name: v.name,
- desc: v.description,
- };
- })
+ },
+ computed: {
+ filteredVariants: function () {
+ const capitalizedPrefix = this.curPrefix.replace(/^\w/, c => c.toUpperCase());
+ const variants = this.st.variants
+ .filter( v => {
+ return v.name.startsWith(capitalizedPrefix);
+ })
+ .map( v => {
+ return {
+ name: v.name,
+ desc: v.description,
+ };
+ })
.sort((a,b) => {
- return a.name.localeCompare(b.name);
- });
+ return a.name.localeCompare(b.name);
+ });
return variants;
- },
- },
+ },
+ },
methods: {
getLink: function(vname) {
return "/variants/" + vname;