Vue.js

Select element inside dropdown menu issue

十年热恋 提交于 2021-01-29 05:19:45
问题 I am currently experimenting in Element UI a beautiful VueJS frame for ui. I am having issue when putting an select element inside a dropdown menu because when I select an item inside the select element it will close the dropdown also. How should I make the dropdown stay whenever I select an item in select element? Here is the sample demo. fiddle https://jsfiddle.net/vy70ogbz/ 回答1: Why dont you use a menu to achieve this. I find it is more flexible, you can use the menu-trigger="click"

Is it possible to build a Standalone Vue app?

扶醉桌前 提交于 2021-01-29 05:16:57
问题 Is it possible to build a Vue app, which does not require Vue as as a dependency at runtime? I.e. instead of the browser having to load the vue.js and the app like this <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> <script src="https://www.myxyzhost.com/my-app.js"></script> have a my-app.js which already includes vue.js, so that including the script in a web page becomes a simple one liner? <script src="https://www.myxyzhost.com/my-app.js"></script> 回答1: So, it was

How to async/await multiple uploads before final form submit?

安稳与你 提交于 2021-01-29 05:14:24
问题 I am trying to allow users to upload multiple files. Each file selected will trigger an axios.post() request... so if a user selects three files then there will be three separate axios.post() requests made to the server to upload the files. There are also other fields in the form such as Name and Description which will be submitted when the user clicks the form submit button. However, I want the form submission to wait until ALL the files are uploaded first. Here is a shortened version of the

vuetify v-slider Cannot get new position after click on slider

时间秒杀一切 提交于 2021-01-29 05:13:46
问题 In my AudioPlayer component, I have a v-slider I cannot get the value after cha,ging the slide position ;-) <v-slider @change="setPosition()" :value="trackProgress" :v-model="percentage" thumb-label></v-slider> data() { return { percentage: 0 }; }, computed: { trackProgress: function() { return this.progress * 100; } }, methods: { setPosition() { console.log("SET POSITION: ", this.percentage); // always 0 !!! // this.setProgress(this.percentage / 100); // this.togglePlayback(); } }, 回答1: You

Vee Validate 3 catch errors on form submit

岁酱吖の 提交于 2021-01-29 05:13:32
问题 How do i catch if form submit fails in vee-validate? I have the following component <template> <ValidationObserver tag='div' class='bg-white pt-6 pb-6 mb-4' v-slot='{ handleSubmit }'> <form @submit.prevent='handleSubmit(onSubmit)' class='mx-auto rounded-lg overflow-hidden pt-6 pb-6 space-y-10' :class="{'is-loading' : isLoading}" > <div class='flex flex-wrap -mx-3 mb-6'> <div class='w-full md:w-3/12 px-3 mb-6 md:mb-5'> <ValidationProvider v-slot='{ classes, errors }' rules='required' name=

How to async/await multiple uploads before final form submit?

旧城冷巷雨未停 提交于 2021-01-29 05:10:39
问题 I am trying to allow users to upload multiple files. Each file selected will trigger an axios.post() request... so if a user selects three files then there will be three separate axios.post() requests made to the server to upload the files. There are also other fields in the form such as Name and Description which will be submitted when the user clicks the form submit button. However, I want the form submission to wait until ALL the files are uploaded first. Here is a shortened version of the

How does Vue overwrite jQuery event listeners

做~自己de王妃 提交于 2021-01-29 05:09:39
问题 I have read that jQuery and Vue tend not to work very well together (see eg. https://vuejsdevelopers.com/2017/05/20/vue-js-safely-jquery-plugin/). As I have a large jQuery app that I am progressively incorporating Vue into, I'd like to understand what's going on under the hood so I can avoid conflicts. Here's a simplified test page: $('#a').click(function() { alert('a'); }); $(function() { $('#b').click(function() { alert('b'); }); }); var app = new Vue({ el: '.container', mounted: function()

How does Vue overwrite jQuery event listeners

北战南征 提交于 2021-01-29 05:09:16
问题 I have read that jQuery and Vue tend not to work very well together (see eg. https://vuejsdevelopers.com/2017/05/20/vue-js-safely-jquery-plugin/). As I have a large jQuery app that I am progressively incorporating Vue into, I'd like to understand what's going on under the hood so I can avoid conflicts. Here's a simplified test page: $('#a').click(function() { alert('a'); }); $(function() { $('#b').click(function() { alert('b'); }); }); var app = new Vue({ el: '.container', mounted: function()

How do i use the id coming from the API response in other parts of HTML & Scripts in VueJS

自古美人都是妖i 提交于 2021-01-29 05:07:39
问题 I am trying to make my code Dynamic without using any hard code. And for that i want to use the id coming from the API. Here is my API Response: [/infos] [ ... { "id": 7, "name": "Highway", "price": "High", "min": "785", "max": "1856", "tag": null, }, { "id": 8, "name": "Lowway", "price": "low", "min": "685", "max": "1956", "tag": null, } ... ] Here is my Component.vue: <div class="vx-row"> <div class="vx-col w-full md:w-1/2 mb-base" v-for="info in infos" :key="info.id"> <vx-card> <div class=

How to drop down programmatically a select menu by clicking on image Vuetify?

妖精的绣舞 提交于 2021-01-29 05:02:08
问题 I have my image property and select in template: <v-img src='/logos/some.jpg' @click='click_select'/> <v-select :items="currencySelect" ref='select'/> and in methods, I have method: click_select(){ this.$refs.select.onClick; } Clicking on image doesn't do anything and no errors logs 回答1: Just add a callback handler for that event like : this.$refs.select.onClick((e) => { }); Full example var app = new Vue({ el: '#app', vuetify: new Vuetify(), data: { currencySelect: ['a', 'b', 'c'] }, methods