Tagged Questions
0
votes
0answers
8 views
Vue.js Spread Operator instead of Vue.set / Vue.delete
I would like to use the spread operator to add/remove object properties while maintaining reactivity.
In a Vuex mutation, the following works:
Vue.set(state.sportTypes.sports, sportName, ...
2
votes
2answers
31 views
How does Vue.js, React.js, Angular.js actually work
This is some sort of question from curiossity.
The question is:
How does these Client-side frameworks work, let me explain.
I am working with javascript for more than 5 years. And I don't ...
0
votes
0answers
9 views
Getting router params into Vuex actions
I would like to pass router params into Vuex actions, without having to fetch them for every single action in a large form like so:
edit_sport_type({ rootState, state, commit }, event) {
const ...
0
votes
1answer
20 views
Ellipsis filter vueJs
I'm rendering dynamically a text content into a dom element with Vue.JS
<article>{{ movie.summary }}</article>
what I'm trying to achieve is creating an auto-ellipsis filter so I would ...
0
votes
0answers
18 views
How to display content by page number clicked on the vue js 2?
My view is like this :
<!DOCTYPE html>
<html>
<head>
<title>Laravel</title>
<link rel="stylesheet"
href="//cdn.bootcss.com/bootstrap/3.3.6/css/...
0
votes
0answers
23 views
Show and hide divs within v-for list items (Vue.js 2)
I have a v-for loop and when the item within that loop is clicked I want to hide div#one and show div#two. Then click a button in div#two to hide and show div#one again. Only for that list item.
...
0
votes
1answer
18 views
How to solve error “Uncaught (in promise) TypeError: Cannot create property” ? (vue.js 2)
My code is like this :
<!DOCTYPE html>
<html>
<head>
<title>Laravel</title>
<link rel="stylesheet"
href="//cdn.bootcss.com/bootstrap/3.3.6/css/...
0
votes
1answer
39 views
Why in the browser does not show anything ? (vue.js 2)
I get from here : https://github.com/JellyBool/laravel-vue-pagination
Then, I clone it and I try on the my localhost
But, after it executed, in the browser does not show anything
I edit code on the ...
0
votes
1answer
28 views
Accessing rootState in Vuex getter
How do you access rootState in getters?
const getters = {
getParams: rootState => {
return rootState.route.params
},
}
The above doesn't work. How is this done?
0
votes
0answers
13 views
Unable to get rootState in getter
Why does this simple getter in a Vuex module fail to do what API reference says?
const getters = {
myGetRootState: (state, rootState) => {
return rootState
}
}
Getter above returns ...
0
votes
2answers
32 views
How to convert JQuery AJAX function to vue.js
I have the following AJAX function written in jQuery (just make AJAX call to get outcome for div A and div B - the example is simplified)
JavaScript
$(document).ready(function(){
$( "#c" ).on( "...
0
votes
0answers
16 views
Vue.js - recursive call of the component through render function. (runtime only)
I have one big request for you. I am a high-school student and I want to create an app for students with my friend. In the begining we wanted to use React for our reactive components, but then we saw ...
2
votes
1answer
61 views
Display links as <a> tags but don't allow other tags?
So, I am using Vue.js and want to display some text that contains links. The text is input by the users.
Example:
This is a site www.example.com which is better than www.oldexample.com
I want it to ...
1
vote
2answers
32 views
How to disable value on the select option ? (vue.js 2)
My component is like this :
<div id="demo">
<div>
<select class="form-control" v-model="selected" required>
<option v-for="option in options" v-bind:value="option.id"&...
0
votes
1answer
38 views
Vue.js does not render correctly using template
I am working with Vue.js and Django. My goal is to display a list of bins, which I get over a REST API.
Here's my JavaScript-Code:
Vue.component('bin-detail', {
template: '#bin-detail',
props: ['bin'...
0
votes
1answer
21 views
Vue.js binding is hiding parent divs and elements (not intended)
I'm building a simple Vue.js page and my HTML snippet is as follows:
<div id="vueApp">
<a href="#" class="button is-outlined" @click="showNextDiv" >Show Div</a>
<div ...
0
votes
0answers
31 views
Unknown custom element: <router-view> - did you register the component correctly
Im trying to set up routes and no components are showing which is due to this error i believe.
I've checked and there are no other router-view tags in the project, ive uninstalled vue-router and ...
0
votes
0answers
19 views
Update data in component with different content vue.js
I got 10 users (for now) in my list in sidenavigation. I show them like this:
<md-list-item class="md-inset">
<router-link exact to="/user" @click.native="saveID(row.id)">
<...
1
vote
1answer
18 views
Show Editable fields on page load using medium-editor
I am using medium-editor js to for the editable fields. When I hover on the respecitve field/s it shows me the fields to edit.
But, I want it to show the editable fields on page load instead of ...
2
votes
1answer
29 views
Vue.js - components data do not update
I have a Vue list that is based of an array and each array item renders a component where I bind the array item properties.
<div v-for="item in items">
<item v-bind:item="item">&...
1
vote
0answers
14 views
vue+webpack, system told me “Module build failed: TypeError: this._init is not a function”
I don't know how to fix it, I have been search too many informations, all of people told me I don't install npm module, but my 'package.json' file has already installed them.
I have installed all ...
0
votes
1answer
21 views
Can't access Vue from js
I'm trying to create an App with Vue, and Vue-ressource
Actually i need to use ressource to made auth system by an API call.
But in my Auth.js (that i import into my login.vue) console said he can't ...
0
votes
1answer
21 views
How to display the value of select option on value input text ? (vue.js 2)
My code is like this :
<div id="demo">
<div>
<select class="form-control" v-model="selected" required>
<option v-for="option in options" v-bind:value="option.id">{{...
1
vote
1answer
11 views
Dependent dropdown with vue js (without ajax)
I'm trying to create a dependent dropdown using vue js. I have created 2 dropdowns:
<div id="app">
<div class="row">
<label for="100">One</label>
<...
0
votes
2answers
18 views
How to create a dynamic class value in a component in VueJS?
So I created a simple component:
Vue.component('m-textbox', {
template: `
<div>
<div class="input-field col s12 m6 l6">
<input :id="id" type="text" :value="value" @input=...
1
vote
1answer
25 views
Property mutation in Vuejs
So I have a multiple codes like this:
<input id="data" type="text" v-model="data">
<label for="data">Data</label>
And I tried to make a property out of it so that I won't repeat ...
1
vote
1answer
18 views
How to create a component for a html code in Vue?
So I have this code:
<div class="input-field col s12 m6 l6">
<input id="txtboxid" type="text" v-model="full_name">
<label for="txtboxid">Middle Name *</label>
</div&...
1
vote
1answer
22 views
How to display response on the option select ? (vue.js 2)
My component vue.js is like this :
<script>
export default{
name: 'CategoryBsSelect',
template: '\
<select class="form-control" v-model="selected" required>\
<...
0
votes
0answers
18 views
How to solve “Uncaught (in promise) TypeError: response.body.forEach is not a function” ? (vue.js 2)
My component vue.js is like this :
<script>
export default{
name: 'CategoryBsSelect',
template: '\
<select class="form-control" v-model="selected" required>\
<...
0
votes
2answers
13 views
Vue.js data not available in created() function
I'm having issues with initialising my Vue component with data from localStorage. Here is a simplified version of my code
new Vue({
el: "#my-element",
created: () => {
if (window....
1
vote
0answers
53 views
Infinite update loop
I'm trying to build a reusable Image Loader component in Vue.js, which should:
Manage its own thumbnail data
Take src from parent as prop
Display different thumbnails based on prop, using same ...
-1
votes
0answers
11 views
How to make autocomplete list using `@` symbol in vue.js with additional parameters?
I want to make component in vue.js 2.0 which uses textarea where use can type markdown based text (with this plugin) but with additional features.
There must be custom element, for example
[user-12]...
0
votes
1answer
25 views
Trigger a watch function whenever any variable is changed in Vue.js
Is there a way I can trigger a Vue.js function whenever a variable within the app changed?
var vm = new Vue({
el: '#demo',
data: {
variable1: 'Foo',
variable2: 'Bar',
.....
.....
...
0
votes
1answer
12 views
Can Vue.js custom directive can be implemented as individual files?
Is there any way that Vue custom directives can be implemented as individual files (ala Vue components .vue file) and be compiled in the root js file? (I'm using Webpack)
I tried the following on app....
1
vote
2answers
27 views
Angular and Vue Templates and Bindings
I a new developer. I have been working to get up to speed. Part of that has made me review Angular, React, and Vue. Each of these seem to use something called "declarative binding" and "templating". I ...
0
votes
1answer
29 views
Vue-js removed selected date from textbox when add new element
Vue-js remove selected date from textbox when add new element. if i entered any text instead of date and add new element text is display as is it. but date is removed.
below is my HTML code
<div ...
0
votes
1answer
19 views
Vuejs post does not find NodeJs Express server/action
I'm trying to send data using vue.js to my node.js server, but the browser console keeps showing me a 404: POST http://127.0.0.1:63342/myaction 404 (Not Found)
vue.js:
this.$http.post('http://127.0....
0
votes
2answers
26 views
Check if it's possible to go forward when using vue-router
I'm developing an application using Vue2 and Vue-router (version ^2.2.0) and the back and forward navigation buttons have to show if the user can go back/forward or not.
To check if the user can go ...
1
vote
1answer
23 views
Vue.js - How to properly watch for nested properties
I'm trying to understand how to properly watch for some prop variation.
I have a parent component (.vue files) that receive data from an ajax call, put the data inside an object and use it to render ...
2
votes
1answer
30 views
Vue.js progress bar
I'm using vue.js 2.0 I've got this method:
calculatePercentage(option) {
let totalVotes = 0;
this.poll.options.forEach((option) => {
totalVotes+= option.votes.length;
});
...
0
votes
0answers
33 views
Force click to be assigned to parent element
The element (+) below is hijacking the dashed div's click event handler, leaving me without access to the div's attributes.
I would like to assign all clicks within the div, to the div.
Using Vue.js
...
0
votes
0answers
28 views
Should I keep every component in separate file? (vue.js)
I'm using vue.js and have a timer/stopwatch component which has the following parts built as separate components. Every component/part has its own file.
digital clock,
note,
controls,
a couple of ...
3
votes
0answers
26 views
When creating a new VueJS instance, does it clone all the child elements in it's specified root element?
Take this HTML for example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="https://cdnjs....
2
votes
1answer
55 views
Bind class to a slot in Vue.js 2
I'm trying to create a reusable component for iterating over items, filtering them, and adding some classes to the slot (if the item is even, odd, first, last etc..)
Here's my reusable component:
&...
0
votes
1answer
36 views
Linking v-model in child to parent value vue js
I have a vue component which is as follows and in the child template I have a text input which I want to use v-model to link it to a var in the parent. But its not working.
How would I be able to ...
0
votes
1answer
30 views
Vue.js: List does not update when using child component
I'm having an issue when using a child component, a list does not update based on a prop passed into it.
If the comments array data changes, the list will not update when it uses a child component &...
0
votes
1answer
40 views
Vue.js simple script don't work
I'm trying to run the code bellow, which is probably the most simple example of Vue.js, but it doesn't work at all:
<div id="app">
{{ message }}
</div>
<script>
var app = new Vue({...
0
votes
0answers
42 views
Why is my view not rendering data from my vue component?
I am trying to get a list of products from an api with a mixture of vue components and the vue-router setup. I am able to console.log data out inside the function that gets the data but I am unable to ...
2
votes
1answer
31 views
Vue.js: Uncaught (in promise) TypeError: $set is not a function
I'm fetching comments from the reddit API and trying to update an array with $set so it can update the view, but I get this error:
Uncaught (in promise) TypeError: $set is not a function
VM ...
0
votes
1answer
29 views
Vue update side navigation automatically
I've got names for 10 users in my sideNavigation.
I fill them in sideNavigation.js like this :
data: () =>({
name1: "",
name2: "",
name3: "",
name4: "",
name5: "",
name6: "...