Skip to content

Instantly share code, notes, and snippets.

@dgleba
Last active February 5, 2019 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgleba/f43210183288e4182c1625e349a743af to your computer and use it in GitHub Desktop.
Save dgleba/f43210183288e4182c1625e349a743af to your computer and use it in GitHub Desktop.
vuetify autocomplete dg-works
<div id="vue-instance">
<v-app>
<v-form>
<v-container>
<div v-if="state.interval === 'monthly'">
Number: <v-autocomplete v-model="selected" v-bind:items="monthlyItems" light autocomplete>
</v-autocomplete>
</div>
Selected: {{selected}}
</v-container>
</v-form>
</v-app>
</div>
var vm = new Vue({
el: '#vue-instance',
data: {
selected: null,
state: {
monthly: null,
weekly: null,
interval: 'monthly'
},
monthlyItems: _.range(1, 39),
weeklyItems: _.range(1, 8)
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.2/vue.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vuetify/1.5.0/vuetify.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.9.1/underscore-min.js"></script>
@import url('https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons');
div {
/* margin: 10px; */
padding: 3px;
};
<link href="https://unpkg.com/vuetify@1.5.0/dist/vuetify.min.css" rel="stylesheet" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment