2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-22 10:30:34 +03:00

just redirect on option click

This commit is contained in:
Jeff
2018-01-22 19:17:38 -08:00
parent df0cc83e05
commit a861b16553
2 changed files with 7 additions and 11 deletions
+2 -11
View File
@@ -59,22 +59,14 @@
to Select2/Chosen without the overhead of jQuery. to Select2/Chosen without the overhead of jQuery.
</p> </p>
<v-select id="v-select" :options="options" v-model="selected" label="title"> <v-select id="v-select" :options="options" @input="redirect" label="title">
<template slot="option" slot-scope="option"> <template slot="option" slot-scope="option">
<span class="octicon" :class="option.icon"></span> <span class="octicon" :class="option.icon"></span>
{{ option.title }} {{ option.title }}
</template> </template>
</v-select> </v-select>
<div v-cloak v-if="!! selected" class="dropdown-action"> <section class="content">
<a class="btn btn-primary btn-outline btn-lg" :href="selected.url">
<span class="octicon" :class="selected.icon"></span>
{{ selected.title }}
</a>
</div>
<section class="content" :class="{ hidden: selected }">
<div class="feature-list"> <div class="feature-list">
<ul class="list-vue"> <ul class="list-vue">
<li>Supports Vuex</li> <li>Supports Vuex</li>
@@ -108,7 +100,6 @@
</a> </a>
</div> </div>
</section> </section>
</div> </div>
<script> <script>
(function (i, s, o, g, r, a, m) { (function (i, s, o, g, r, a, m) {
+5
View File
@@ -40,5 +40,10 @@ new Vue({
}, },
] ]
} }
},
methods: {
redirect(option) {
window.location = option.url;
}
} }
}); });