vuejs2

How to get data from firebase when page loading using vuejs?

 ̄綄美尐妖づ 提交于 2021-01-29 05:38:28
问题 I have been trying to get current user data from firebase to display details in profile page. Here i am trying get data from firestore, when page loading. My table structure : users => Current user UID => email, firstname, lastname, businessname, etc. I have added functionality to get data from firebase when profile page loading but does not work. error showing in console product.data().firstname is not function. And also i did not get any console output firebase data retrieved or not? here

Vue.js: How to open/handle existing project by SourceMap or bundled files

五迷三道 提交于 2021-01-29 05:21:13
问题 Sorry for my stupid question. I am new in vue.js. I have vue.js project without source codes. I have to read Vue components and improve it. But some friends told me that it is imposimble to convert it back. Is it really imposible? Project file structure: /js -app.js -app.js.map -manifest.js -manifest.js.map -vendor.js -vendor.js.map 回答1: On vue >=2 that's basically impossible. Take a look here: https://forum.vuejs.org/t/any-method-or-workaround-to-decompile-dynamically-compiled-components

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

How can I use transition on individual list elements in Vue.js?

烂漫一生 提交于 2021-01-28 14:45:21
问题 My understanding of transitions in vue.js is that you use <transition> to animate between individual elements and <transition-group> to animate a whole list. It seems as though if you wanted to animate a transition within a list item you'd use <transition> within the list. e.g. something like this: <span v-for="item in items"> <transition> <div> Transition from this... </div> <div> ...to this. </div> </transition> </span> Yet, when I make that change the animation doesn't work. Is this an

Using a javascript library/plugin within Vue code

☆樱花仙子☆ 提交于 2021-01-28 14:18:48
问题 So, I am trying to use the pretty neat component vue-social-sharing but this is the first time I am using such a libaray and am not sure how to set it up properly. I have installed it via NPM, but then get lost on the first section "Usage, Loading the library" Specifically, it says "Browserify / Webpack" var SocialSharing = require('vue-social-sharing'); Vue.use(SocialSharing); But, I am not exactly sure where that goes, how it is setup etc. Do I set it in some Webpack file somewhere? or

VUE js call a child component method in a different component hierarchy

你。 提交于 2021-01-28 11:32:12
问题 I have this following vuejs component hierarchy. What i want to do it to invoke COMP_B_ONE validate() method, when COMP_A_TWO submit() method is invoked EVERY TIME. MAIN_COMPONENT COMP_A_ONE COMP_B_ONE validate() COMP_B_TWO validate() COMP_A_TWO submit() I've already implemented an emit when submit is triggered in COMP_A_TWO which can be listened in MAIN_COMPONENT submit() { this.$emit('submit') } what seems to be the best approach in this regard? any suggestions appreciated. 回答1: I can get

Using Axios and Vue to fetch api data - returning undefined

跟風遠走 提交于 2021-01-28 11:11:12
问题 Running into a snag with trying to integrate my API with Vue/Axios. Basically, Axios is getting the data (it DOES console.log what I want)... But when I try to get that data to my empty variable (in the data object of my component) to store it, it throws an "undefined at eval" error. Any ideas on why this isn't working for me? Thanks! <template> <div class="wallet-container"> <h1 class="title">{{ title }}</h1> <div class="row"> {{ thoughtWallet }} </div> </div> </template> <script> import

Count the occurrences of a child component

血红的双手。 提交于 2021-01-28 10:56:39
问题 I have a single file component like this: <template> <div> <template v-if="offers.length > 3"> <a href="#">View all offers here</a> </template> <template v-else-if="offers.length > 1"> <offer v-for="offer in offers" :data="offer"></offer> </template> <template v-else-if="offers.length == 1"> <offer :title="The offer" :data="offers[0]"></offer> </template> </div> </template> Based on the number of offers , I choose how many to render. Question: How do I efficiently get/count the number of

Vue2 call parent method from child in looped component

旧街凉风 提交于 2021-01-28 10:41:05
问题 I'm looping root component, which have with child component. <root-select v-for="offer in offers" > <child-options v-for="item in options" > </child-options> </root-select> But, when I $emit root function from child, all my roots component changed those data. child: EventBus.$emit('toggle', value); root: EventBus.$on('toggle', this.toggle); But I need, that data changes only in triggered component. Thanks. 回答1: Try not to use Event bus to emit. Use normal Emit way to emit from child to parent

Add CSS style to v-html

与世无争的帅哥 提交于 2021-01-28 09:54:21
问题 I would like to add style to HTML code in a v-html . I tried several solutions but nothing functional :( Here is my code: Template : <div class="para" v-html="value" /> Script : export default { data () { return { value : "<h2> TITLE </h2> <p> PARA </p>" } }, } Style : .para >>> h2 { color: blue; } .para >>> p { color: red; } Thanks in advance ! 回答1: If you're using scoped style without SASS, use the >>> combinator this way: >>> .para > h2 { color: blue; } >>> .para > p { color: red; } If you