vue.js (pronounced "view") is a progressive JavaScript framework that centers around declarative rendering.

learn more… | top users | synonyms

1
vote
2answers
27 views

vue-axios `catch` function doesn't trigger when expected

I have a Vue app in a single file component which allows the user to lookup a github username and see the fullname, login, and country the user is from. Here is my component: <template> <...
1
vote
1answer
20 views

Vue2: Why do I get infinite $http.get requests when I assign property from response?

I make $http.get call to back-end where I process data and return a result, and I want to assign property to this dynamically (the property is declared in data list): watch: { send_amount: ...
1
vote
1answer
22 views

Do Vue watched properties cache just like the computed properties?

In the Vue docs it is mentioned that computed properties are smartly cached as opposed to using regular methods: In comparison, a method invocation will always run the function whenever a re-render ...
0
votes
2answers
15 views

How does one handle ' in user-supplied data in vue.js?

So I have a block of user-supplied text I'm pulling in from a CMS. However, in that string is a simple ' which blows up the whole string and returns an error. I'm trying to locate a solution to keep ...
0
votes
1answer
23 views

Vee-Validate only validate one field

I am using vuejs 2 and use vee-validate 2.0.0-beta.18 for validation. But run into problem when I called this.$validator.validateAll() it only validate one field. This is the jsfiddle. This is the ...
3
votes
1answer
18 views

How to use vue-datetime-picker in single file component

I am trying to use vue-datetime-picker <vue-datetime-picker class="vue-picker4" name="picker4" :model.sync="result4" type="time" ...
1
vote
2answers
26 views

How do I watch all keys in a data object in Vue 2

My data object: data: { selected: { 'type': null, 'instrument': null }, My template: <select v-model="selected['instrument']" @change="switchFilter('instrument', $event)"&...
2
votes
1answer
36 views

How to filter comments with vue.js?

In my view i have this : <select class="sort_by"> <option selected disabled>SORT BY</option> <option value="name" >Name</option> <option ...
0
votes
2answers
25 views

Vuex: accessing store directly or passing properties?

I'm migrating a pure Vue application to Vuex, and I'm not sure about the best way to pass data to the components downstream. The Vue way is to pass them as properties: <component :my-prop="myProp"/...
0
votes
0answers
12 views

Merging API and client app for Heroku deployment

I have a VueJS client app which consumes a PHP / Laravel API. They are developed separately and have their own GIT repos. I'd like to deploy both to Heroku as a single application so they can share ...
1
vote
1answer
16 views

Vue Js - issue with axios Performing multiple concurrent requests with laravel

alright I have small issue may be but I can't figure it out. if I pass only one http request using axios all work good. but when I use multiple request I get result in console log but can't able to ...
1
vote
3answers
32 views

Treeview with nested inputs with VueJS

I'm trying to build a treeview component comporting inputs in order to change my source json. The binding part seems to work fine but the hide/show action on branches is broken : HTML : <div id=...
1
vote
1answer
14 views

Do something after response is finished?

What im trying to do is add in array some data after response is finished. Im trying to check if reponse is ready but without success: this.$http.post('/blog/article/' + articleid + '/comment', ...
0
votes
1answer
20 views

vue.js vuefire firebase storage image url

I'm new to Vue and Firebase. In VueJS, I am trying to replicate the Firebase friendlychat function that returns the proper image URL for an image stored in Firebase storage ( FriendlyChat.prototype....
0
votes
3answers
44 views

VueJS 2.0 server-side rendering: How to get data only once using preFetch and beforeRouteEnter?

To test VueJS server sider rendering, i'm trying to figure some things out. I've used the latest VueJS Hackernews 2.0 as my boilerplate for this project. Currently i'm stuck with this: The server ...
0
votes
2answers
25 views

How to add active class to specific element?

I have this methods : methods: { replyBox: function(e){ e.preventDefault(); this.isActive = !this.isActive; ); }, In view i have this: <...
1
vote
0answers
12 views

Call method from another component VueJS version 1

I want to call the method from another component in let's say parent component... So, let's say I have notie.vue and there's my method named 'flash' and I want to call that after API request when I ...
0
votes
2answers
24 views

className not working in VueJS method

I want to change the classNames of all elements with the class on "link". I am using a method which is called via a click action on the element. I tested out getting a length from the function and ...
0
votes
1answer
27 views

Vue js add dynamic fields in list with remove and sort not working

I am using Vue js 1.0.25 with vue-router. I want to create a list using dynamic textboxes. The basic idea is on clicking Add Answer button, it should create a dynamic text-box along with its index ...
2
votes
2answers
87 views

Vue.js Server Side Rendering: document is not defined

I am using a package which uses document and window. I want to make my website have server-side rendering without changing too much code. For window is not defined, I use window-or-global (https://www....
0
votes
1answer
16 views

how to declare method in 'vuejs' as for 'Handlebars.registerHelper'?

I'm going from "Handlebarjs" to "Vuejs". I want to declare a method that is invoked in several parts of my code. As for Handlebars.registerHelper (); please help.
1
vote
1answer
35 views

Conditional v-if is working only for the first time?

I have this in my view: <div class="already_voted" v-if="already_voted" > <p>You already voted or your are not allowed to vote</p> </div> This is my method : upvote: ...
0
votes
0answers
25 views

How to access vuex state objects?

I try to duplicate an object from the vuex state. My state is structured like that: state = { trips: [ { date: '01.01.2017', driver: 'John Doe' }, { date: '03.01.2017', driver: 'Mike Astor' ...
2
votes
1answer
39 views

Vue Js binding 2 values to a tag href

I'm beginner on Vue js. I'm facing an issue where I have to update two values while rendering. <ul class="category-list"> <li v-for="category in categories"> <a v-bind:href=...
0
votes
0answers
24 views

Language in VueJS from JSON

I am trying to load locale language variables from a JSON Request (laravel generated) to VueJS since VueJS does not support locale out of the box. The ready function alert does not alert but the ...
1
vote
1answer
13 views

Vue.js 2 - v-model on component

I have the following component: Vue.component('test-component',{ template: `<div> {{value}} <button on:click="updateValue();">update</button> </div>`,...
0
votes
1answer
37 views

How to add vote without refresh with vue.js?

I have a problem when I try to vote, because i need to refresh page so that vote appears. Any suggestion how can I make my vote appear in my view without refresh? In my view i foreach comments : @...
0
votes
1answer
38 views

Vue 2 - How to set deafult type of array in props

I have my Vue component, which is taking an array of objects as a prop. I use prop validation often, especially for 'default' value feature. in this case I have: props: { items: Array } but I'd ...
0
votes
1answer
43 views

How to change upvotes and downvotes directly in databes with vue.js?

I'm dislaying my comments from databse: @foreach($comments as $comment) <div class="comment_list"> <div class="row"> <div class="col-...
0
votes
1answer
25 views

Check if v-model is empty?

I want to prevent if user didnt enter anything. I tried like this but its not working: if(this.comment === ' '){ return; } This is my entire method: postComment: function(user_id,...
0
votes
2answers
56 views

How to wait for ajax call from main Vue instance?

I currently have VueJS components that makes an ajax call to github like so: (Child) component Vue.http.get('user/repos').then((response) => { console.log(response); }, (response) => { ...
0
votes
0answers
42 views

Send data to components in VueJS + Vue Router

I can't pass data from app to compenent. After render it shows only clear html, without data from vue. All works, but without data(( My code from app.js: var Series = Vue.component('Series', ...
0
votes
1answer
33 views

Vue.js is not working when its in seperate file?

When i put my script code in seperate file in js then my component is not working, only when i directly write code in view. Any suggestion why is that happening? https://jsfiddle.net/coligo/txpy7ug4/ ...
0
votes
0answers
38 views

What is the appropriate way to change component view-model data from within a Vue.js directive?

While reading the documentation on writing custom directives for Vue, the section on Directive Hook Arguments states the following: Apart from el, you should treat these arguments as read-only and ...
0
votes
1answer
25 views

How to use VueJS to highlight an item in a list

I'm pretty new to VueJS and I'm trying to use it to make a playlist app. The first part of making a playlist was pretty simple: var playlist = []; var playlistCurrentlyPlaying = 0; // TODO: ...
0
votes
2answers
21 views

Toggle inside v-for items affects the entire list, how can I make the each toggle affect only the containing list item?

I'm making a list of items with v-for loop. Inside each item of the loop there is button with click event method that showing description text. When i click on the button, it should toggle only inside ...
0
votes
0answers
17 views

[Vue warn]: Unknown custom element: <post> - did you register the component correctly?

I'm trying to create my first component but i have problem. Any suggestion how can i fix this This is my jsbin: http://jsbin.com/hijuyofeko/edit?html,js,output <div id="home"> <div class=...
1
vote
2answers
187 views

VueJS 2: Catch event of direct child component

I'm currently trying to get a simple Tabs/Tab component up and running. It seems like something in the event handling mechanism has changed, therefore I can't get it to work. Current implementation: ...
2
votes
1answer
41 views

element Ui: Carousel - How to set current slide

I have hard time to figure out how to use the carousel and more specifically how to set the current slide. Here is the doc of the component Here is the fiddle <div id="app"> <button v-on:...
1
vote
1answer
40 views

Pass php variable to vue component instance

How can I pass a value of a variable to a vue component? In my example, i have an inline template client-details, i get this view from laravel so now i want to pass the id which comes with the url /...
0
votes
1answer
31 views

Clearing input in vuejs form

Just completed a todolist tutorial. When submitting the form the input field doesn't clear. After trying both: document.getElementById("todo-field").reset(); document.getElementById("#todo-...
-1
votes
0answers
35 views

Thinking in Vue js if I have an AngularJs background? [closed]

Suppose I'm familiar with developing client-side applications in AngularJs 1, but now I'd like to start using VueJs. Can you describe the paradigm shift that is necessary? Here are a few questions ...
0
votes
0answers
48 views

DOM is not getting updated on updating VueJS data object

I have a VueJS data object in JS script. The JS script is linked at end of the page. So first HTML will is getting rendered. Then VueJS data object will be initialised. After initialising data object, ...
2
votes
1answer
32 views

Vue.js - apply a class by default unless a class is manually added?

I'm just starting out in Vue.js and I'm a bit stuck figuring out if this is possible. Given the following component: <button class="button large primary-gradient">{{ text }}</button> If ...
1
vote
1answer
28 views

Vue passing data to the component

My child Vue component always returns undefined when I try to pass data to it from the parent Vue object. Here is how I define the component: var Candidates = Vue.extend({ template: '#...
0
votes
1answer
41 views

Vuejs call $refs

<div> <button @click="$refs.cart.open()">open</button> <drawer></drawer> </div> ref=cart is inside <drawer>, can I call from that button? how? ---...
1
vote
0answers
36 views

VueJs dev tools panel not showing

I started using vue dev-tools in my application but it is not visible when in developer mode in Chrome. I tried various solutions found on the dev-tools github page and in other places on the web, but ...
1
vote
1answer
30 views

Vue 2/VueRouter : can't refresh page when on children routes

I can't figure out what's happening when I navigate on a child route (in the example above http://<mydomain>/applis), and then refresh the page => I have a Not Found // The requested URL /...
1
vote
1answer
26 views

Create href for each “v-for” using basic list rendering

What is the correct way to add custom href to each link in the list? For example, i want that link: 'News' would have href="http://example.com/news". Is there a possible way to do something like ...
1
vote
1answer
37 views

VueJS connecting to external data

I am learning VueJs. I have done a simple project you can see here: var vuePosts = new Vue({ el: '#vue-posts', data: { posts: [ {title: 'title 1', body: 'message 1'}, {...