All Questions
12 questions
0
votes
2
answers
79
views
I need to unstructure an object to update the variables defined in data
it's my first post. I need to destructure to update a variable defined in "data", I have the following code snippets. I'm using VUE.
data: () => ({
id: '',
phone: '',
email: ''
}),
...
-1
votes
2
answers
5k
views
How to create a Javascript object with index and values with variables?
I have a problem in my javascript code, i need to create an object with variables and those variables being objects too. Explanation:
I need this in my javascript code (similar to a Json structure):
...
0
votes
1
answer
308
views
Flatten data from an object with an array of objects
In my Vue project, I'm doing an API call to my Laravel (nova) backend, the data is returned as follows.
As you can see the data is an array, which contains an array of objects. Each array represents ...
0
votes
3
answers
289
views
Changing key value of object without discarding rest of keys
I would like to replace spaces with underscores for a specific key in all incoming objects. It works, however the rest of the keys dissappear.
The objects:
{
"id": "235",
"reference": "AA"...
0
votes
2
answers
710
views
VueJS sort/order an array of objects by a specific property
I have an array of contact objects that all of an isPrimary property. Only one of them should be true, but regardless I would like to sort any primary contacts to the top of the array. I'm using ...
1
vote
2
answers
45
views
Defining methods/functions on Javascript Objects
Is this:
saveUpdate() {
// Some code
}
The same as:
saveUpdate: function() {
// Some code
}
Is there a best practice (ES6) way to define methods on objects (specifically, Vue.js components)?
...
-1
votes
2
answers
1k
views
Why am I getting Cannot read property 'startsWith' of undefined in this for loop?
I am trying to sort an array by 'version' and then identify all string that begin with 'iPad'.
The following code does not log anything and returns an error.
orderedUsers: function () {
let ...
-2
votes
2
answers
149
views
Which is the best way to filter data from an array with Vue JS?
I'm looking for best practices.
I get this product list from my API:
[
{
"id": 6,
"name": "Pechuga de pollo",
"category": "Chicken",
"existencia": 100
},
{...
2
votes
3
answers
11k
views
How to format an Array of Arrays of Object in JS
I want to formatting this Array in a computed property in VueJS, but I have one problem in the moment to access to newArray, all of elements in one only array
getNewArray(){
const newArray = []
const ...
0
votes
2
answers
372
views
vue data function syntax
I'm getting following syntax error when compilling my assets:
Syntax Error: SyntaxError: C:\xampp\htdocs\dtcburger.com\resources\js\components\stripe\STRIPEform3.vue: Unexpected token, expected ";" (...
1
vote
4
answers
115
views
Filter out object by properties (not deleting)
I have an object which looks like this:
var myObj: {
2:"None",
20:"A",
31:"A",
32:"A",
Social:"B",
Method:"None"
}
I am trying to return the object without the 'Social' and '...
0
votes
1
answer
201
views
Concat object array with the same name
I have an app in vue.js with vuex that implement some modules, what I'm doing is concatenating objects to get some actions, getters, mutations.
Like this:
const files = require.context('../../...