Vue.js is a library for building interactive web interfaces. It creates data-driven user interfaces with a simple and flexible API.

learn more… | top users | synonyms

0
votes
0answers
5 views

vue.js: toggle css class onClick in child component

I am new to vue.js. I have a grid of divs (two nested vue.js components). I want to toggle the css class of a div if the user clicks on the grid. My idea is to toggle a boolean isMarked on grid ...
0
votes
1answer
13 views

Issue with emitting events in Vue with eventHub

I have a component that needs to emit an event at some point in its life. This event is to be listened to by a sibling component. I am using an event hub for this communication. However, I am ...
1
vote
0answers
15 views

Vue.Js - Add data to an array and assigning to the props (help)

i have a problem, that i want to make my component could add new sidebar menu item each item user clickin an add button. so basically my component should appear when user defining their own sidebar ...
-2
votes
0answers
11 views

Which VueJS version to use?

I just started reading about VueJS the other day and it looks like fun. I'm not part of a company but I would like to use it to make a website. I don't know much about npm or webpack or browserify ...
0
votes
0answers
17 views

Get the selected checked value from the ul list in Vue.js

I am tring to use Vue.js in my project. But, I do not know how to get the checked value in ul list from the dynamic API data? The getQuestion API is like this: { "code": 0 "data": { "question": [...
1
vote
0answers
12 views

Vue.js 2.x: `v-model` and `:type`

:type is not supported by v-model, but works with :value + @input. If it is just syntactic sugar, why the difference? https://vuejs.org/v2/guide/components.html#Form-Input-Components-using-Custom-...
1
vote
1answer
20 views

Client-Side form validation with Vue 2

I am developing an application with with Laravel 5.3 and Vue 2 I implemented a form-validation via Vue 2 but the it doesn't check the request for any errors on client-side it firstly lets every single ...
0
votes
0answers
11 views

Vuex nested loop, how to handle v-model on select/option

In my application I need to use a nested v-for to display a list of elements with a select-option.. This is the scenario <div class="stuck" v-for="box in items"> <p>Pick an option for ...
0
votes
2answers
21 views

Vue.js won't update it's place to edit

I've been having troubles with my new side-project. Saw Vue.js, thought it was cool and gave it a try. This is where I insert my new blog post: <input class="form-control" placeholder="Title" v-...
0
votes
1answer
36 views

VueJS custom component

I need add to my component jquery cropit plugin. So I added cropit to my package.json and install next I tried <template> <div id="image-cropper">...</div> </template> ...
1
vote
2answers
46 views

Dynamic navigation component in Vue.js

The idea is to have 'isActive' boolean array in the Vue instance in order to update it every time the navbar gets loaded, i.e using the current page name taken from the URL as an index in the array ...
1
vote
1answer
25 views

Getting the event source from custom events in Vue?

I'm building a Vue component that consists of an unspecified number of child components. Only one child component is visible at all times, and the user can only switch between child components when ...
0
votes
0answers
17 views

Making vue-awesome work with Nuxt

I am trying to make vue-awesome work with my Nuxt project. I modified my nuxt.config.js with this vendor: ['vue-awesome'] I did this in my default.vue import Icon from 'vue-awesome'; export ...
1
vote
1answer
17 views

Vue - How to use a different socket.io port in tests?

I'm using socket.io in a webpack/vue project (built by vue-cli). This is how the client initialized socket.io: var socketlib = require('socket.io-client') var socket = socketlib('http://localhost:...
0
votes
1answer
13 views

Vue component unknown despite being registered

I am trying to compose a component inside another like this: <prompt :users="users"> ... <dataset v-for="ds in users" :user="user"></dataset> ... </prompt> But apparently I'...
0
votes
1answer
14 views

get database data from mysql to vue.js in servlet

Front end : html, Backend : java servlet , I have to get data from database to vue.js for show in html tag without servlet help, how can I get that data? Task is todo list, when I m click on that ...
1
vote
1answer
30 views

Module not found: Error: Can't resolve 'ode_modulesue-loaderlibcomponent-normalizer'

I've recently decided to give vue-cli a go but after I run npm install, running npm run dev gives me the following error. Module not found: Error: Can't resolve 'D:Projects estapp ode_modules ue-...
-1
votes
2answers
19 views

VueJS - Multiple js files in dist after building

When I run "npm run build", instead of getting the single build.js file, I'm getting 4 or 5 javascript files. Those javascript files have around 1MB in size. Why is this so? Below is the folder ...
0
votes
3answers
26 views

How to change a Vue.js data value within a method called by a DOM event?

Disclaimer: I know that there is data biding in Vue.js. So I have this: <html> <body> <div id="app"> <input @input="update"> </div> <script src=...
0
votes
1answer
18 views

What does !important mean in vue.js? [duplicate]

What does !important mean? I am new to vue.js and I am seeing this piece of code included after values in style sheets. I can't find it in the docs.
0
votes
3answers
68 views

How to update data on a page without refreshing on the vue.js?

My view is like this : <div class="favorite" style="margin-bottom:5px;"> @if (Auth::user()) <add-favorite-store :id-store="{{ $store->id }}"></add-favorite-store> ...
0
votes
0answers
25 views

Passing data to a component in render using vue-loader

main.js: import Vue from 'vue' import App from './app.vue' let vm = new Vue({ el: '.layers-container', render: h => h(App), }) //This doesn't work, layers undefined console.log(vm.layers)...
0
votes
1answer
45 views

How to redirect to login page if unauthorized user try to click? (vue.js)

My code is like this : <script> export default{ props:['idStore'], methods:{ addFavoriteStore(event){ $(function () { $(...
0
votes
0answers
13 views

Why is a watch off by one tick in vue.js?

I would like the height of one element to be synchronised with the height of another element. The contents of the second element change with time. An example of such code is below (and in a JSFiddle):...
0
votes
0answers
8 views

How do I include testing in an existing project created with vue cli?

When I do vue init webpack my-project according to these instructions, I'm given a questionaire where I'm asked if I want to include linting and testing. If I say yes, the project is set up with ...
-1
votes
1answer
73 views

Promise.all() resolves immediately

I'm trying to take some action after upload completion of multiple images, using Promise.all. However, the code after then runs before the code being dispatched. What am I confusing here? ...
0
votes
0answers
14 views

How to fix Vue 2 + UIKit autocomplete template?

i have a problem with Vue 2 + UIKit autocomplete. UIKit autocomplete template is the following code <script type="text/autocomplete" v-pre> <ul class="uk-nav uk-nav-autocomplete uk-...
0
votes
1answer
23 views

Update a child's data component to the father component in vue.js using .vue webpack(vue2)

I am testing the components of vue.js and I encountered the problem of updating a parent component when the child changes. I have generated the project with vue-cli (webpack), and I am using ...
2
votes
2answers
35 views

How to update one componet from another component in vue.js

I have web app where interface is based on vue.js 2.0. I have component which displays input based on select2 plugin. By default it shows selected options, but when user clicks on it, I show select2 ...
1
vote
1answer
25 views

Calling methods in Vue build

While looking at references I see examples using Vue in the browser, e.g. Vue.component ({ el: 'example', }); that can then invoke methods like example.method(); outside the component How would ...
0
votes
2answers
27 views

Accessing inputnum in <input inputnum=“1”/>

I have created a button that adds file inputs, and would like to display thumbnails for each input. However I am having issues accessing the custom binding :inputnum on the input. When I console....
0
votes
2answers
29 views

how to send data with click event in Vue.js

I have this simple example written in Vue.js. // vue instance var vm = new Vue({ el: "#app", data: { matrix: ["", "", "", "", "", "", "", "", ""], }, methods: { ...
0
votes
2answers
41 views

How to add condition in method vue.js 2?

My code is like this : <template> <a href="javascript:" class="btn btn-block btn-success" @click="addFavoriteStore($event)"> <span class="fa fa-heart"></span>&...
1
vote
2answers
80 views

How to get response ajax on the vue.js 2?

My code is like this : <template> <a href="javascript:" class="btn btn-block btn-success" @click="addFavoriteStore($event)"> <span class="fa fa-heart"></span>&...
1
vote
1answer
33 views

Vue component not showing (Laravel 5.3)

I'm trying to get Passport setup on Laravel 5.3, but the Vue components don't seem to be showing up in the blade. Here is the code for my blade: @extends('connect.frame') @section('title') API ...
1
vote
1answer
23 views

Mutating Arrays Vuex

The following mutation does not work: const mutations = { [types.UPDATE_IMG_URLS] (state, newArray) { state.imageUrlArray.concat(newArray) }, (...) } However this one does: const mutations =...
0
votes
0answers
32 views

Vue2 router do not work when type manually

I have such code: created: function() { if(!localStorage.hasOwnProperty('auth_token')) { router.replace({name: 'login'}); } else { if(router.history.current.name == 'login') {...
1
vote
1answer
35 views

Switching from vue-resource to axios

With vue-resource, we could set the root url in main.js like so: Vue.http.options.root = 'http://localhost:3000/api' I tried replacing that with: axios.defaults.baseURL = 'http://localhost:3000/api'...
0
votes
0answers
19 views

Vue.js method called multiple times using $emit and $on when it should only be called once

I'm using a bus to allow components to interact with other components via the method described in this link: https://forum.vuejs.org/t/create-event-bus-in-webpack-template/4546/2 . I have a method ...
0
votes
1answer
26 views

Cloning a Vue.js object?

I want to log a Vue.js object with console.log(obj), but all properties are displayed with reactiveGetter() and reactiveSetter() functions instead of their values. How can I clone a Vue.js object, so ...
0
votes
1answer
30 views

Vue.js conditional rendering in older browsers

I'm trying to filter a collection by a search term. When I use the es6 syntax and built in features such as string.includes('') it works fine. Unfortunately I have to support a few versions of IE ...
1
vote
1answer
35 views

Vue - v-bind error:v-bind' is an undeclared prefix

i'm working in asp.net with Orckestra CMS (before Composite) and Razor Templates and try to use Vue framework. All is fine when using {{option.text}} <select class="form-control" id="myExample1"&...
1
vote
1answer
24 views

How to access a method from vuejs component?

I am building a Tic Tac Too game with vue.js framework. I have declared a vue component called grid-item, when this item is clicked I want it to call the handleClick method. when I run the code ...
0
votes
1answer
26 views

Vuejs deferred events on ajax content

I have some vuejs events. <div @mouseover="activate" @mouseout="deactivate" class="item featured"> They work fine but when the content is loaded in via a simple jquery load() it does not ...
4
votes
3answers
34 views

Accessing returned data from jQuery load

I'm working on a vue.js component and I've got this computed property: loading_asset_status(){ var img = $("img.modal-main-image").attr('src', this.current_image.img_url) .on('...
1
vote
1answer
31 views

How to add a Favorite - UnFavorite Button with vue.js 2?

My view is like this : <div class="panel panel-default panel-store-info"> ... <div class="favorite"> <add-favorite-store :id-store="{{ $store->id }}"></add-...
1
vote
1answer
18 views

Vue 2, Cannot reference Prop Object in template

Problem: Although from the Vue DevTools I am passing the prop correctly and the router-view component has access to the data that it needs and in the correct format, whenever I try to access any of ...
0
votes
1answer
20 views

How do I remove Vue from being loaded when using elixir?

I am using Laravel 5.3 and elixir to compile my Sass and JS. My /resources/assets/js/app.js file contains only 2 lines: require('./bootstrap'); require('./search'); search.js contains some custom ...
1
vote
2answers
31 views

How to run some javascript code only on small screen/mobile devices

I am building a vue web app which will be used across all devices. I have some code which I want to get executed only on small devices or mobile. Currently I have that code in a if condition with $(...
3
votes
1answer
35 views

How dynamic add events to a tag in my custom grid component

<template> <tbody> <template v-for="(row,index) in datalist"> <tr @click="rowevent != null?rowevent(row,this.$el):''" :class="index % 2 === 0?bodytrclass[0]:bodytrclass[1]"...