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
1answer
17 views

How to pass href value to template in Vue

This is the HTML. <navlink v-bind:href="#about">About</navlink> And the main.js code is Vue.component('navlink', { template: '<li class="item"><a><slot></slot&...
0
votes
0answers
14 views

Changing Vue template contents dynamically

I am trying to use this package: https://github.com/james2doyle/vue-file-upload-component However, the template built-in to vue.file-upload.js does not match the style of my app. How do I change the ...
3
votes
2answers
23 views

How to define a reusable function in vue component namespace

here is my code: Vue.component("ro-webview", { props: ["src"], template: `<div> <div> <div class="col-md-2 list-inline"> ${this.getIcon("fa-arrow-left")} ${this.getIcon("fa-...
0
votes
1answer
16 views

Components and Slots approach

I have actually 2 global components one for Admin and other one for Modal. The Admin component have a child comp called Page and the Page comp have others childs. I want to pass content directly to ...
-1
votes
0answers
16 views

How to time travel(rollback) in a state tree using Vuex?

How can I achieve a time travel feature using Vuex ? I want to go back for a previous state, to undo something. Is that possible out of the box ? Any idea on how to achieve that ? was hoping for ...
1
vote
0answers
26 views

Any ideas why is my Vue.js app working in a codepen but not locally on a jekyll site?

I created a pricing calculator using Vue.js with codepen and recreated here. it seems to be working fine but when I add it to my jekyll site and run it locally, no vue data is displayed. I am ...
1
vote
0answers
22 views

Laravel elixir angular and vue

guys! My project based on Laravel framework. For main site using Angular, but for admin panel need vue. I finded this package Larave-Angular with all configs. Package has this gulpfile const elixir ...
-1
votes
0answers
13 views

Vue.js alternative for vue2-filters for deep filtering

I am trying to implements functionality similar to deep filtering in Angular $filter('filter'). One alternative is to use vue2-filters package and use filter by filter here. Is there any ...
2
votes
1answer
40 views

The content not shown properly in function callback in Vue.js

I've got two problems here. The first is that I can't get the star rendered properly. I can do it if I change the value in the data() function but if I want to do it in a function callback way, it ...
3
votes
1answer
22 views

Retry failed ajax request in vuejs

What's the best way to retry failed AJAX request in VueJS ? bulkDecline(requests, decliner) { requests = _.map(requests, 'id'); return Vue.http.post(`${baseUrl}/api/decline/${decliner}/bulk-...
1
vote
1answer
14 views

Binding a UI element with a Vuex store

I'm trying to bind a UI element (a single-line textbox or 'input' element) with a Vuex store. This fiddle has the code. When the SearchResult component is visible, it auto-updates -- see the GIF ...
2
votes
1answer
32 views

v-model in dynamic component

I have a list of dynamic components that I render with a for loop. <component v-for="component in components" :key="component.componentId" :is="component.type" :...
3
votes
1answer
68 views

How to position an element under the cursor if its parent has “margin: 0 auto”?

I'm building a simple draggable functionality: <div id="app"> <div id="i-plane"> <div id="i-interact" v-bind:style="position" v-on:mousedown="handleDown" ...
1
vote
2answers
17 views

How can I re initialize same components in different routes

Scenario: I have a multi-step form, if the user clicks on the next button, the only thing that changes in the route is the id e.g. form /step/:id, but whenever I have steps/routes that contains the ...
0
votes
1answer
31 views

Element doesn't position itself under mouse

I'm buiding a simple drag functionality: <div class="i-plane"> <div class='i-interact' @mousedown='handleDown' :style='position'></div> </div> <script> data: { ...
2
votes
1answer
21 views

Show updated value on click

I have a function that adds items to a cart, when an item is already in the cart, I expect it to only add 1 to quantity of that item(which it does). The problem is I can't view the updated quantity ...
2
votes
1answer
23 views

Is there way to hook vue component ready (initialize)

see my demo, I hope hook component ready with following code: <body> <div id="app"> <ro-tag></ro-tag> </div> <script> Vue.component("ro-tag", { ready: ...
1
vote
2answers
29 views

img url with vue.js

Can someone help me with using the img tag with vue.js? Per the vue.js documentation, I tried: <img v-bind:src={{ imgURL }}> //prints a null image Here is my jsfiddle Can someone help?
1
vote
1answer
31 views

How can i add event listener in Vue customized directive?

I'm using Vue2.x and I want to add a event listener by using customising directives.however in vue1.x I can use the flowing code snippet: Vue.directive('demo',{ bind () { let self = this ...
-1
votes
1answer
30 views

v-for insert second v-for child

I have 2 tables in JSON containing the following [    {"Id": "1", "name": "Joe"}, {"Id": "2", "name": "Mark"} ] Other [ {"Student": "1", "note": "5", "assessment": "1"}, {"...
1
vote
2answers
22 views

Need an example vue-router (vue 2.x) for a Layout.vue with other route based components

I cannot figure out how to set this up properly using vue-router with vue.js 2.x I want App.vue to be a main site layout module which contains basic site level things like footer, logo, main nav, etc....
1
vote
1answer
11 views

The `router-link-active` classname unexpectedly applies to a <router-link> which is pointing to `/`

I have set up very basic routing on a Vue project using vue-router. The router-link-active classname gets applied as expected to the active root. In the following gif, that would be 'Foo' when /foo ...
1
vote
1answer
34 views

how to call a method on the component by clicking Vue.js?

I am use component of the dialog window dialog.vue from vue-mdl package <template> <div class="mdl-dialog-container" v-show="show"> <div class="mdl-dialog"> <div class="mdl-...
2
votes
1answer
23 views

Vue change style in for Conditionally

I have a v-for and I need to change a style according to the return of a given data. <div id="beerApp"> <ul> <li v-for="cervejaria in cervejarias"> <span class="...
1
vote
0answers
14 views

Babel Errors in Cloud 9 IDE

Getting a bunch of babel errors when running npm run dev with the Vue cli. This only happens in Cloud9. Any thoughts on what could be the issue or how to disable errors like this before running ...
3
votes
1answer
25 views

Vue multi-purpose components?

I have a small app that lets you add, remove and edit recipes to a list of recipes. Adding has the route /add and editing has the route /edit. I am using a component called AddRecipe for both routes. ...
1
vote
1answer
21 views

Inject data into scope without <template>

I would like to get rid of two lines in the html used in a vue 2.x application. The lines with <template scope="props"> and the corresponding </template> should not be necessary. <...
1
vote
1answer
30 views

How to write directive with custom prefix ? so something different than `v-`?

Is there any way in vue.js 2.x to define a directive WITHOUT the v- prefix ? All our angular 1 directives already have a prefix and when converting we dont want to (and also dont think it to be ...
1
vote
0answers
23 views

vue.js $HTTP.GET return NULL PHP RESPONSE

I'm trying to consume an API and the $ http.get only returns NULL. I call a PHP that returns a json What nonsense am I doing? <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/...
2
votes
1answer
21 views

vue.js 2 list of objects in component

I'm very new to js frontend frameworks, and I'm trying to learn some vue.js. In particular I'm trying to render an array of Note objects that have an id, description and date attributes. I'm ...
0
votes
0answers
20 views

Materilize inside Vue.js

i am new with Vue.js and i want to make my project with Materialize. I try a lot of plugins like: vue-materialize (https://github.com/paulpflug/vue-materialize), vue-material-components(https://www....
1
vote
1answer
20 views

Vue.js router init works with router.map not with the Router constructor

In my app, I use the vue-router. Routes work when I pass them to the router with router.map({}), but they don't work when I pass them in the constructor. Any idea why this is? // works: const router =...
1
vote
1answer
36 views

can't set select defaut value

temlate <bm-offer-confirm inline-template> <select v-model="selectedCard"> <option v-for="card in cards" v-bind:value="card.id">@{{card.info}}</option&...
-2
votes
0answers
17 views

How to use HTML/JQUERY Admin & Dashboard elements in Vuejs as component

I found THIS Admin & Dashboard framework very useful and complete and everything you want to develop the Admin panel is included. So the question is how to convert these pure html/jquery pages to ...
1
vote
1answer
31 views

How to run Vue cli with Webpack on live server?

Yesterday I bought a droplet from digital ocean, to start learning new stuff direct on a live server. I started with Vue. I followed the Vue cli with webpack installation guide. All went well. The ...
1
vote
2answers
28 views

Using external js library within vue.js app

I am trying to use an external JS library that generates a drawing canvas (atrament.js) within a vue.js app. I am not sure what is the right way of doing this. Right now I am just doing: <script ...
0
votes
0answers
21 views

How to access browsers Window global from Vuex action

I am getting the following error when I try to update the sessionStorage from my vuex action. Is there a way to "import Window from '???'" or some other way to access the sessionStorage? ERROR in ./...
1
vote
1answer
21 views

vue-resource $http not Work

I'm trying to use vue with vue-resource without success. what am I doing wrong? Follow the code I'm using CDN I'm starting with the vuejs and I appreciate the help. <div id="beerApp"> <ul&...
1
vote
0answers
39 views

Scoped CSS not being applied within the component

I have the following form component: <template> <div> <form> <input placeholder="Recipe Name"> <textarea placeholder="Recipe Description....
3
votes
2answers
48 views

One global data structure in Vue.js

I am building a single page app with Vue.js. It's a relatively simple app, more like an extended, opinionated spreadsheet. I'm using vue-router to handle different views of the app, some are used to ...
1
vote
1answer
29 views

line in vue.js function executed before the previous ended

I have the following function to submit a form: methods: { submit_form: function () { this.drawing = dat.toImage(); this.$refs.my_form.submit() } } The drawing variable is assigned to an ...
3
votes
1answer
43 views

Stars fade out after click in Vue.js component

I want to make a star-rating component in Vue.js and the problem now is that after I click the stars, it fades out before showing the final result. Below is the JSFiddle link: https://jsfiddle.net/...
0
votes
1answer
28 views

How to access array elements inside vue.js conditional css class

I'm getting starting with Vue.js and I have a simple page set up to experiment with conditional css. <div id="app"> <div class="demo" @click="handleClick(0)" :class="{ 'red': attachRed[0] }...
4
votes
1answer
37 views

Vuejs - When should jquery plugins be initialised

I have some JQuery plugins that need initialising, normally this could be done using $(document).ready(function () { }) but this doesn't appear to work when doing it within a vue components created ...
2
votes
1answer
20 views

Locutus in VueJS template engine

How can i implement Locutus in my VueJS application? I am using webpack. I tried to to the following in my single file component: <template> <div>{{ nl2br('My string here') }}</div&...
2
votes
1answer
20 views

Vue.js how to set :id prefix string?

class="tab-title" v-on:click="tab" v-for="(tabTitle,index) in tabTitleList" :id="index" I found this example in an vue community, but in my situation, I want my "id" has a prefix, not just a ...
-3
votes
0answers
23 views

What can replace the websocket to connect with IOS?

anyhow, thank you. sorry for English poor, when i reload page, websocket aways close, and can't reconect. (ios App is run in backstage) i can't get the phenomenon real causes。put some code of ...
1
vote
1answer
27 views

How to use npm package: vue-material with laravel 5.3?

I try to install a packages from https://www.npmjs.com/package/vue-material-datepicker but its showing error again again my question is how to add any npm packages in laravel 5.3 from scratch
1
vote
1answer
33 views

Binding Input in Vue not working

I would like to call a function with a value when a user starts typing in an input box. I have tried two approaches. The first approach is trying to use two-way binding to a model. However, after ...
0
votes
1answer
46 views

How to setup a centralized state for a mapbox map in Vuex?

I just started using vuex with vue. I do (roughly) understand the docs. I have a specific issue for which I am not sure whether I should use vuex and if so how to go about. I have an app in which ...