Tagged Questions
Vue.js is a library for building interactive web interfaces. It creates data-driven user interfaces with a simple and flexible API.
0
votes
0answers
5 views
Vue.js dynamic component loading + hot reload
I have Laravel 5.3.21 application with Vue.js 1.0.28
I'm using hot-reload workflow with browserify-hmr plugin.
Here is the simple gulpfile.js used to achieve that:
var elixir = require('laravel-...
0
votes
2answers
28 views
Why does vue.js not update the dom in this case?
I am writing a (very) simple datepicker control in vue.js, using moment.js for formatting and mutating the date.
The problem I'm having is that even though the date instance in the component is ...
0
votes
1answer
16 views
Vue and data from REST API
While playing around with vue.js I noticed some strange behavior while trying to display on a page data from an API, but here's the strange thing :
using vue 2.0.0, i can see the "Title", but I have ...
0
votes
1answer
6 views
Vue Directive on Laravel Collective Html Form
How do I use a vue.js directive on a form object created using laravel collectives library.
ex: {{Form::open(['route' => 'route.name'])}}
How would I add v-mydirective to the <form> tag?
0
votes
1answer
5 views
Run code when $refs.theReference has been set
I'm showing/hiding a canvas dynamically, and when it's about to be shown, I want to draw on it. I use a data variable (true/false) to insert/remove the canvas, and I watch it to draw on it when this ...
0
votes
1answer
23 views
How to access to a child method from the parent in vue.js
I have two nested components, what is the proper way to access to the child methods from the parent ?
this.$children[0].myMethod() seems to do the trick but it is pretty ugly, isn't it, what can be ...
0
votes
1answer
9 views
Passing event and argument to v-on in Vue.js
I pass a parameter in v-on:input directives. If I don't pass it, I can access the event in the method. Is there any way I can still access the event when passing the parameter to the function:
This ...
0
votes
1answer
9 views
Laravel Echo Vue Js TypeError: Cannot read property 'push' of undefined
I'm having an issue particularly with Vue Js hoping someone can point me in the right direction. I am using Laravel's Echo feature which is connected to Pusher. I currently am getting data back from ...
0
votes
2answers
9 views
Watch all properties of a reactive data in Vue.js
I had an API call to the backend and based on the returned data, I set the reactive data dynamically:
let data = {
quantity: [],
tickets: []
}
api.default.fetch()
.then(function (tickets) {
...
0
votes
1answer
12 views
Vue: shared data between different pages
var app = new Vue({
el: '#app',
data: {
sharedData : ""
},
methods: {
goToPageB: function() {
if (some condition is met) {
window.location....
0
votes
0answers
21 views
Create a nested array JSON in Vue.js (using v-model )
I am new Vue.js, I am working invoice project using Vue.js.
I want out put like this, output:
{
"invoiceFirstLevelCategory": [{
"categoryname": "first1",
"price": 30,
"...
1
vote
1answer
27 views
Keeping things DRY in Vue.js
I've done a couple of projects with React in the last year and I've switched to Vue for my current one, attracted by its greater simplicity, less verbose nature and the fact that you don't have to ...
0
votes
1answer
10 views
Strange behavior by mixing vuejs 2.0 and Thymeleaf with SpringBoot
I've written some pages using Vuejs 2.0. In the static mode, all my components work and I could validate the design.
So, I've tried to integrate the source of these pages into a Web Spring Boot ...
0
votes
2answers
22 views
Naming the model and initliaze it dynamically in Vue.js
I am aware in Vue, every reactive data properties need to be declared in the Vue instance.
I have a situation where I need pull sets of data from the server, say tickets, and I need to have a model ...
1
vote
3answers
19 views
Lagging in v-on:change
I had an input with v-on:change directive in it to call some method I declared inside the Vue objects. But I realized there are delays in calling the method whenever the value is changed.
I ...
1
vote
1answer
40 views
Vue SPA: Compile appended HTML after API request
Using:
Vue Router for SPA page rendering
JQuery based Grid render library(Kendo UI)
Use case:
Vue renders all components but the grid, which is rendered by this external library.
When someone ...
0
votes
0answers
16 views
Vue.js Mixin method does not fire from Separate component
I've struggled some days with the mixin functions from separate component and it's just not firing up.
For example I have a method function from my component:
removeUser: function(users) {
...
0
votes
1answer
16 views
The vue.resource() method and the api.json file
I'm new to vue.js and I'm confused about what to do next in the program. I want to add a new view page to collect customer information (see code below). I don't know how to write the function after I ...
0
votes
0answers
12 views
Wathchify output process info
I've setup watchify for vue and it's works fine, but I want to see process info - something like watchify process takes *.**s e.t.c. For each change.
Watchify in console just stay silent:
This is my ...
0
votes
1answer
26 views
How to to position a caret in a contenteditable div while ignoring the HTML tags?
Thes following code sets the caret based on the value of caret:
<div ref="editable" contenteditable="true">
This text can be edited by the user. Right away.
</div>
<button type="...
1
vote
2answers
48 views
Unable to debug radio buttons being unchecked randomly
Kindly see: https://jsfiddle.net/chrzrdx/krrczkx5/
This is on vue 2.1.4
I have a questions array in my vue.data, and I'm cycling through them every time the next or prev button is pressed. I store ...
2
votes
1answer
36 views
Vue.js: How to pass in data that isn't a parent / access vue methods?
I'm working on a simple timer app. I'm getting 3 pieces of data from the server: timers, projects and users. I believe I'm looping through timers correctly, but I'm not sure if I should be passing in ...
2
votes
2answers
26 views
Oddity with templates and root node with vue.js
I think this is possibly a bug I've stumbled across, not sure. I'm getting this Vue.js warning for a component:
vue.js:2611 [Vue warn]: Cannot use as component root element because it may contain ...
0
votes
2answers
26 views
Pass data between extended components OR call method of component
I have main component which fetch list of users in Created() method. Two next components extended of main component. In this case created method calls each time at extended components created. So i ...
2
votes
0answers
19 views
Vue objects got split on server
I have a weird situation on one of my work projects using VueJS and a Python backend. It may no even related to Vue at all.
I'm using the $data property of a Vue component to store the params I'm ...
0
votes
0answers
19 views
Laravel App with NodeJS image server
Structure
PHP server -> Has API and authentication (uses JWT and has vuejs SPA)
Node server serves images.
Logic
Users with admin rights can add data to the api. (Already taken care of)
When an ...
4
votes
0answers
28 views
How to distinguish between component instances in Vue Devtools
When I look at my application state in Vue's devtools chrome extension, I can see multiple instances of the same component in the tree view. However, there is no way to distinguish one instance from ...
1
vote
1answer
30 views
Laravel+vue - Props is undefined
so I am new to vue, but getting up to speed. However, I cannot make the props thing to work - it always remains undefined in my child component.
The idea of the below is to create a app-wide ...
1
vote
3answers
25 views
VueJS + Rest API list rendering issue
I have a Spring Data Rest backend and in src/main/resources/static html + js assets which work fine. My issue is that I can't understand how to render the data picked up from the webservice in the ...
3
votes
3answers
34 views
Vuejs: Detect Change Event On Computed Value
Goal
I want to detect only a change event to searchTerms.
Problem
The watcher currently triggers on each keypress, but I don't want that many events.
Context (View Fiddle)
<template>
<...
2
votes
2answers
23 views
Vue JS Option element “selected” is only attribute, need it as property
Trying to get an option to be selected by default if selected is present on the option object
This is what i have:
<template>
<select v-model="model" :placeholder="placeholder">
...
0
votes
0answers
12 views
Aframe + vuejs - core:schema:warn Unknown property `color` for component/system `undefined`. +10ms aframe.js:327
I'm trying to get Aframe and vuejs to work well with each other, however the console is returning warning messages. I'm guessing this is due to aframe checking the attribute values before vue gets a ...
3
votes
2answers
38 views
How to pass data(json) to vue instance
I have a simple Vue instance and want to pass json from the backend to vue without HTTP request because it's always the same.
I've tried do this with props, but it doesn't work...
In DOM it's looks ...
0
votes
1answer
26 views
Vue js create component programmatically
I have a modal component that I want to be able to insert programmatically when I want. There is a way to do this with Vue?
For example:
Vue.component('modal', {...})
Then in any component I want ...
0
votes
1answer
30 views
Structuring calls to update global and local state
Some of my components doesn't want to store all state globally. Two examples:
messages component: usermessages are fetched and stored locally because they are only needed for the current component. ...
0
votes
2answers
21 views
Nested-routes is not working in vue-router 2
Here is the codes.
html
<div id="app">
<nav>
<ul>
<router-link to="/user">User List</router-link>
</ul>
</nav>
<...
2
votes
3answers
53 views
Displaying images of various unknown dimensions consitently
I am building a small web app that queries top tracks and artists via the Spotify API to return and display these to the user.
I am displaying each track or artist with Bootstrap panel, the name of ...
5
votes
1answer
24 views
vue 2 trigger computed with chinese input issue
I'm using vue2 to delveop my project.
I found that the computed property will only trigger when we keyup/keydown chinese input to a word.
(ex: ㄨㄛˇ => 我 It will only trigger 1 times not 3 times ...
1
vote
1answer
38 views
Vue.js what's the difference of $emit and $dispatch?
In vue2.0 the event $dispatch and $broadcast is deprecated.
And I found that $dispatch is similar with $emit.
What's the differences between them? Is it safe directly replacing $dispatch into $emit ...
1
vote
1answer
27 views
Is the solution for passing data up the chain in Vue.js really to chain event listeners/emitters?
The Vue API Docs/Guide talk about the pattern of parents passing props to children, who communicate back up to their parents via events. Additionally, the guide stresses that children absolutely ...
1
vote
1answer
21 views
Vue - Toggle class through multiple buttons
I have a Vue component, which displays a Vote button. When the user clicks on the Vote button an .active class gets added. Now I need to make sure only one Vote button can have this .active class at ...
0
votes
2answers
23 views
Vue js - Getting Methods to work in Components
I have a component that passes in data, then I need to change that data from true to false on click. I have created a method called toggleClass for that but it's not working, and I am not getting any ...
1
vote
1answer
40 views
having an issue with a VueJS class binding issue, using vuejs v2.0+ Bootstrap v3.3.7
Okay, I am having an issue, albeit a strange one, I have been all over and cannot seem to find the answer.
We were assigned to create a shopping cart with Vue.js, which I have completed I started ...
1
vote
3answers
37 views
Vue.js - repeat an element a specific number of times
I would like to use Vue.js to repeat an element n times, based on the num-labels prop.
<label-parent num-labels="4"></label-parent>
This is my component:
<template>
<div id="...
1
vote
1answer
21 views
Dynamic click handler for Vue.js component?
I've been developing a generic Field component for use in forms in a Vue web app I'm developing. In my EditProduct component, for example, I have multiple instances of the Field component, some of ...
1
vote
1answer
31 views
Vue.JS v-bind:style syntax not working?
I'm fairly knew to Vue and the whole v-bind thing is throwing me for a loop...
Basically, I'm trying to achieve this syntax, but with Vue's v-bind, since I can't use a variable in an inline CSS style:...
1
vote
2answers
39 views
vuejs update parent data from child component
I'm starting to play with vuejs (2.0).
I built a simple page with one component in it.
The page has one Vue instance with data.
On that page I registered and added the component to html.
The ...
1
vote
1answer
27 views
Vue js with vuex computed properties with v-for and v-model
I need to use v-for with v-model. I read the docs and there is no example of how to use it with v-for without performing mutation outside the mutation handler.
How can I use v-model inside v-for ...
0
votes
0answers
38 views
Create changeable container for component
I develop component, but I need, what would can change the tag name of a component container.
Like this:
<my-component tagName="section"></my-component>
render to
<section>... my ...
2
votes
2answers
36 views
Vue 2 and child component events with multiple components
I've read this question / answer, and whilst that works when the parent contains a specific component, in my scenario the parent contains this:
<component :is="currentView"></component>
...