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

1
vote
0answers
14 views

How to access component data from slot?

It's not working: https //jsfiddle.net/2ouxsuLh/ It's happening because myAwesomeData isn't defined in parent component, and we can't use component's variables with . Instead of this, we need to ...
0
votes
0answers
12 views

Vue 2 component re-render after switching dynamic component inside it

I have a main component that import two other components: admin page login page in the main component I have: <template> <div id="app"> <component v-bind:is="currentView">&...
2
votes
1answer
24 views

How to disable data observation in vue.js component property

I want to create a Vue.js component that receives properties from its parent component, e.g.: <table-cell :value="foo" format="date" /> Because value and format are defined as properties, Vue ...
0
votes
0answers
11 views

Vue props become null?

I've got this component in my vue.js app: export default { props: ['forums'], methods: { increment(forum, index) { ForumService.increment(forum) .then(() =...
0
votes
0answers
22 views

Acces Auth in vue.js

Is I'm using Larave. 5.4 with Vue.js 2.0. Is it possible to use Auth::user() in a vue.js template? For example: <template> <p>{{ Auth::user()->name }}</p> </template> ...
0
votes
1answer
12 views

How to load the <script> part of a Vuejs single file component before <template>

In connection to the question I asked here, I have realised that my issue maybe because the template is being loaded before the script and when it gets an error that the variable is not defined, it ...
0
votes
1answer
20 views

vue js and external jquery library

I have project on Laravel with Vue js 2. I created component Card.vue where i want to use jquery file upload plugin- https://github.com/blueimp/jQuery-File-Upload/wiki/Basic-plugin for that i need ...
0
votes
1answer
13 views

Declarative router link not clearing model in Vue component using VueRouter

Developing a task scheduler the path '/task?id=10' fills the component model with an async response with the task information, that works ok. In the navigation bar I have the following router link: &...
0
votes
0answers
13 views

Vue JS how set different drop down list from different value

Very confused how to use Vue JS, at this moment. Any one can help much appreciate. Vue.http.options.root = window.location.hostname; Vue.http.headers.common['x-CSRF-TOKEN'] = $('#token').attr('...
0
votes
2answers
33 views

vuejs v-for add bootstrap row every 5 items

I have an array of items like 'Item 1', 'Item 2' up to 'Item 25'. I want the HTML after rendering look like this: <div class="row"> <div>Item 1</div> <div>Item 2</div&...
0
votes
1answer
15 views

How to require webpack generate js file with requirejs?I use vue-cli

I make my project by vue-cli. vue init webpack vue-demo cd vue-demo npm install npm run dev Now I want to devolop some components. And i want to use them in requirejs. webpack config entry: { ...
0
votes
1answer
28 views

how use npm packages with Vue SPA

i have created Vuejs app using vue-loader,now i need to use an installed npm package as follow : var x = require('package-name') Vue.use(x) but i have this error : Uncaught ...
0
votes
0answers
24 views

Audio assets not found in Vue/Webpack

(See fiddle forked from webpack vue-cli sampple) Why are image assets successfully bundled by webpack, but audio assets aren't? (I'm using a project derived from the vue-cli webpack project) When I ...
0
votes
1answer
23 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
28 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 ...
0
votes
1answer
28 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
20 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
29 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
37 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
50 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
28 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
23 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
19 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
14 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
16 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
32 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
20 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
27 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
73 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
1answer
16 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
9 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
77 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
25 views
+250

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
28 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
43 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
81 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
35 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
38 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 ...