vue-component

Is allowedDate not usable for async or ajax on the vuetify?

孤街浪徒 提交于 2020-02-25 13:24:05
问题 I want to ask methods: { allowedDates(date) { console.log(date) } }, it will console.log all date on every month selected But if I add script ajax/async like this : methods: { allowedDates(date) { console.log(date) this.getData({appDate: date}); // this is async/call ajax on the vuex store } }, it's async without stopping is allowedDate not usable for async or ajax? docs : https://vuetifyjs.com/en/components/date-pickers#date-pickers-allowed-dates Update I try to testing for make sure like

How do you display a name in v-select for a vue-dropdown?

倾然丶 夕夏残阳落幕 提交于 2020-02-25 10:08:48
问题 Im dynamically rendering a V-select in my vue-app by a computed property in my component, but my select is populated with [object Object] instead of the values. How can I set the name-property? Am I doing this wrong? The dropdown is its own component: <template> <v-select :items="listOfCompanys" label="Lokation" item-value="name" item-text="name" single-line bottom ></v-select> </template> <script> export default { name: 'companydropdown', computed: { listOfCompanys () { return this.$store

Vuejs typescript this.$refs.<refField>.value does not exist

只谈情不闲聊 提交于 2020-02-21 09:48:29
问题 While rewriting my VueJs project in typescript, I came across a TypeScript error. This is a part of the component that has a custom v-model. An input field in the html has a ref called 'plate' and I want to access the value of that. The @input on that field calls the update method written below. Typescript is complaining that value does not exist on plate. @Prop() value: any; update() { this.$emit('input', plate: this.$refs.plate.value }); } template: <template> <div> <div class="form-group">

Vue-Test-Utils Unknown custom element: <router-link>

僤鯓⒐⒋嵵緔 提交于 2020-02-20 06:43:27
问题 I'm using Jest to run my tests utilizing the vue-test-utils library. Even though I've added the VueRouter to the localVue instance, it says it can't actually find the router-link component. If the code looks a little funky, it's because I'm using TypeScript, but it should read pretty close to ES6... Main thing is that the @Prop() is the same as passing in props: {..} Vue component: <template> <div> <div class="temp"> <div> <router-link :to="temp.url">{{temp.name}}</router-link> </div> </div>

v-select component not loading into HTML

拜拜、爱过 提交于 2020-02-08 02:30:06
问题 I am trying to create a basic site, where I need to select options from a dropdown menu. I am using the Select.vue from the vue-strap library to implement the same. However, the v-select component in not loading onto the html. Given below is the App.vue which inherits Select.vue from vue-strap: <template> <div> <app-header></app-header> <v-select v-model="selected" :options="['Vue.js','React']"></v-select> <app-footer></app-footer> </div> </template> <script> import Header from './components

Vue 'export default' vs 'new Vue'

别等时光非礼了梦想. 提交于 2020-01-30 13:43:06
问题 I just installed Vue and have been following some tutorials to create a project using the vue-cli webpack template. When it creates the component, I notice it binds our data inside of the following: export default { name: 'app', data: [] } Whereas in other tutorials I see data being bound from: new Vue({ el: '#app', data: [] )} What is the difference, and why does it seem like the syntax between the two is different? I'm having trouble getting the 'new Vue' code to work from inside the tag I

@change method is taking the previeous selected value of select box

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-25 10:15:12
问题 I have a country Id which is bind by v-model. Whenever I change the select box i call an event @change which calls a method country_change that will fetch the value of the states belongin to that perticular country id. The porblem is that the states which I am fetching belongs to the prevously selected country id, not the country id which is currently selected. Seems like as if the @change method is running before the v-model bind value of country id is being changed. <select class="custom

@change method is taking the previeous selected value of select box

纵饮孤独 提交于 2020-01-25 10:14:22
问题 I have a country Id which is bind by v-model. Whenever I change the select box i call an event @change which calls a method country_change that will fetch the value of the states belongin to that perticular country id. The porblem is that the states which I am fetching belongs to the prevously selected country id, not the country id which is currently selected. Seems like as if the @change method is running before the v-model bind value of country id is being changed. <select class="custom

Vuetify insert action button in data-table and get row data

故事扮演 提交于 2020-01-25 08:50:05
问题 Environment: vue@^2.6.10: vuetify@^2.1.0 I want to use v-data-table to show search results and add evaluate button in each row in the v-data-table . Unfortunately I have two issues: Evaluate buttons are not shown I don't know how to get row data of pushed button What do I need to change? Template <v-data-table :headers="headers" :items="search_result" > <template slot="items" slot-scope="row"> <td>{{row.item.no}}</td> <td>{{row.item.result}}</td> <td> <v-btn class="mx-2" fab dark small color=

How to show/hide parts of an object after in Vue

一曲冷凌霜 提交于 2020-01-25 08:48:05
问题 I am creating a features page for a product. When you click the feature name, it should expand a box below and provide a description. I took a small snippet of my data which is basically structured like this: { "Section": { "Page1": { "FeatureName": "Feature desc", "FeatureName": "Feature desc" }, "Page2": { "FeatureName": "Feature desc", "FeatureName": "Feature desc" } } } I have figured out a few ways to do this, but personally don't think any of them are great approaches. Looping through