Posts by guastallaigor • 1,294 points
68 posts
-
0
votes0
answers15
viewsQ: Add dynamically Lifecycle Hooks using Vue.js 3
Good afternoon. I have some components in Vue.js on npm and I received a request to put compatibility with Vue.js 3 (at the time these components were made with only version 2.x in mind). The…
-
0
votes1
answer34
viewsA: Share code (React or Vue) between more than one project
So I had a case similar to this once. In a company that I worked with, we had created because of our own library of components, and as new projects were emerging, we had to copy all the components.…
-
1
votes1
answer322
viewsA: Filter data using v-select in Vue
Sorry for the delay in responding. In case the problem I imagine is happening, is that you are filtering the array with only one variable users for sex. However, the second time you lost all the…
-
2
votes3
answers2043
viewsA: I can’t solve a javascript exercise
Well, I changed the code a little but I think eNumeroDaSorte(15) must be false, according to what you described, for it is not 15, even if it is multiple of 3, and eNumeroDaSorte(7) is also false…
-
1
votes1
answer45
viewsA: Is it possible to set default props on vuetify components?
Basically what I advise in this case is to isolate the vuetify component with the props default in another component in your application. I made an example below very simple, however in your…
-
1
votes2
answers94
viewsA: How does the reader know which table of my comic will be used for my operation?
Try to put a variable protected $table = 'nome_da_sua_tabela: namespace App; use Illuminate\Database\Eloquent\Model; class AnimalPerdido extends Model { /** * The attributes that are mass…
-
1
votes3
answers341
viewsA: Doubt in Vue computed method using Vuex
In this case, the name of the method within the computed does not need to be the same name as the variable, but the name of the attribute that is within the state must be the same name as the…
-
0
votes1
answer88
viewsA: Is it possible to separate the value from the JSON item?
One can use the Object.keys(), where it will return the object keys instead of the values. I made a very simple example below: Helloworld.Ve <template> <div class="stackoverflow">…
-
3
votes1
answer387
viewsA: How to list an Array with . map()?
Just to go through all and show, is usually used the foreach. In the case of map it could be used, however it is usually used to create a new array resulting from the change of the array in…
javascriptanswered guastallaigor 1,294 -
0
votes1
answer45
viewsA: String manipulation
See if this helps: CSS: .legenda, li, .dublado { display: inline-block; } a { text-decoration: none; } PHP <?php $string = '<div class="legenda">Legenda</div> <li><a…
-
1
votes1
answer2040
viewsA: call a function within another function in js
I didn’t understand the code very well, it’s a bit confusing and I didn’t pass the HTML. I tried to adjust the code to remove the errors as I understood, see if it helps: function vetores() { var i;…
javascriptanswered guastallaigor 1,294 -
1
votes1
answer33
viewsA: Inline vuejs edition
I tried it below: new Vue({ el: '#app', data: { nota:'nota', edit: '', myclass: 'before', pincel: 'before', list: [ { "id": 0, "Firstname": "Humberto", "Lastname": "Lopes", "Email":…
-
0
votes2
answers40
viewsA: Date format in php
Simplest way to do, working as String, turning the date into an array with explode. I don’t know if it helps you or if you wanted to work as a date. Follow below: <?php $data = '2016-2-26';…
-
2
votes2
answers66
viewsA: How to assign all the characteristics of one object to another, except one in particular?
Try with the Spread Operator. It will actually perform a copy of the object, and not point to the same reference: let Bherk_tropa_Inimigo = {...Bherk_tropa}; Bherk_tropa_Inimigo.id = "BherInimigo";…
-
0
votes2
answers3109
viewsA: Center text in header
Try this below, I used the display:flex and its estates in class texto-header: header { background-image: url('img/background.jpg'); height: 100vh; width: 100%; } .texto-header { display: flex;…
-
1
votes1
answer849
viewsQ: How to break lines using template string (ES6)?
I have a request for the back-end and your URL is very large. this .$http .get(`backoffice/usuarios/${this.id}/grupo/${this.grupo}/filial/${this.filial}/multinivel/${this.multinivel}`) .then(({ data…
-
0
votes2
answers284
viewsA: Autofocus and Required in javascript hidden fields
I believe you can use the focus() and the setAttribute("required", ""), to make the SITUATION field be required and focused when it appears on the screen. Check below: window.onload = function(){…
-
0
votes2
answers51
viewsA: Does not return PHP result
As it stands, I believe you’re calling the function incorrectly, and you’re doing the return of the result before allocation in the field, ie would never perform the assignment in the field…
-
0
votes2
answers273
viewsA: Center DIV on Bootstrap Grid
See if this helps you, I put a class teste. If so, then simply rename the class. .airbnb-embed-frame{ text-align: center; color: white; display: table-cell; vertical-align: middle; overflow: hidden;…
-
1
votes1
answer82
viewsA: I have a question in the html and css of this code
If you want to put inside the Divs, the problem is the position:absolute that you are using in the scoring classes. Using only the display:flex, flex-direction:column already keeps the score just…
-
3
votes2
answers1376
viewsA: How to simulate input script by Javascript (without Jquery)
I don’t know if I understand correctly, I made a very simple example that simulates typing a word into a input. If it is a phrase or something more complex, I ask you to make it clearer please in…
-
2
votes2
answers638
viewsA: error: "table sales has 6 Columns but 5 values Were supplied"
Try something like this if the ID is incremental in the bank: INSERT INTO vendas (Empresa, Modelo, Preco, Kilometragem, Ano) VALUES ("Movidas","RENAULT SANDERO 1.6 EXPRESSION 8V FLEX 4P MANUAL",…
-
3
votes3
answers1739
viewsA: Cleaning Up Form Fields
I don’t know exactly if there is any way to change all the elements at once. One way I know to resolve is to change individually into one loop. In the example below, I store all the HTML elements…
-
1
votes1
answer140
viewsA: Problems to render Vue.js main.js
From what I understand, you’re trying to access a property of data, in case the message who is in his main.js in a component page.vue. If so, this will not work. You should have this variable inside…
-
1
votes2
answers116
viewsA: The Else is not recognized
There are some problems in your code: There’s no semicolon (;) after if and else; How are you trying to compare with the value of prompt typed by the user, the letter A would be a String, so it…
-
1
votes3
answers883
viewsA: Add columns Vue.js
I believe that in your answer the problem is that you are using interpolation, and how you are using an <input> within the <td>, one can use a v-bind:value or just :value to accomplish a…
-
2
votes1
answer3336
viewsA: Vuejs - Popular select with API data
I will try to help based on what I understand and your responses in the comment. There are some details that may be influencing your problem. 1. data () always must be a function and it must return…
-
0
votes2
answers1155
viewsA: Pick up input values
Your code has an error in const adicionar, because it does not exist in your HTML, this should be checked. Focusing on the doubt itself, to access the value of input just use it like this: const…
-
7
votes2
answers107
viewsA: What is the function of this "=&" operator in PHP?
He will always fall in echo "ok" for this =& is not an operator of comparison rather a attribution by reference. This operator will actually connect the two variables by reference, that is, by…
-
0
votes0
answers34
viewsQ: How to add Laravel HTTP-Tests to a PHP package?
I am creating a PHP package, with Composer for when it is finished being published in Packagist. This package consists of many requests in other Apis, in case I am using the Guzzle. To perform the…
-
1
votes1
answer59
viewsA: Icons like the ones in boostrap
If it’s about the icons of Bootstrap, you can put on the page any icon of Glyphicons, available on the website, this being only one <span> with the classes that makes the visual change. For…
-
0
votes3
answers5180
viewsA: How to generate random numbers in javascript, differently
Try something like this: function obterNumeroAleatorio(n1, n2) { const min = Math.ceil(n1); const max = Math.floor(n2); return Math.floor(Math.random() * (max - min)) + min; } function…
javascriptanswered guastallaigor 1,294 -
0
votes1
answer135
viewsA: Insert v-for data into css class in Vuejs2
I didn’t quite understand the doubt, but I think the problem is in the way you’re using the interpolation. The interpolation "{{}}" is used only between the tags, and not within them, referencing…
-
0
votes2
answers42
viewsA: Plural in time_ago
I saw that already solved, but in my opinion I would prefer to use the ternary, because the only case where it is not necessary the concatenation with the letter "s", is specifically in the word…
phpanswered guastallaigor 1,294 -
0
votes1
answer40
viewsA: Formatting input
You can try something like adding another validation. It’s not the best answer, but I think it will solve: $('#campo').keypress(function(event) { if (((event.which != 46 || (event.which == 46…
-
0
votes1
answer26
viewsA: All Divs close when I click to open another but one does not close
Apparently you missed putting the class tab on Divs, being that you are using this class to perform the display:none, goes below: function openLink(evt, animName) { var i, x, tablinks; x =…
-
4
votes1
answer1709
viewsA: Variables in App.Vue
A way to do, if in case you own a <router-view> in your App.Vue, and the component you are sending the 'Client Test' fill-in event is one level down only, you can create an event that will…
-
1
votes1
answer2326
viewsA: Conflict Resolution in Git
Everything I need to do with Git, I use on Gitkraken. It is a tool with an interface for several (if not all) Git’s, diverse facilities and speed to perform Git activities, compared to bash, as:…
-
0
votes1
answer938
viewsA: submit form with vuejs
I’ll tell you what I did, first I performed a clean installation of a new project with the command vue init webpack my-project. Then I copied the code sent in the images (what is here a advice, do…
-
3
votes1
answer438
viewsQ: When to perform e2e testing on your application?
I am starting in e2e (end-to-end) testing, specifically in projects Vuejs with Spectron and Nightwatch. This question will not have code, because my doubt in this case is not with them, I am able to…
-
0
votes5
answers939
viewsA: Centralize H3 in the Section
If the problem is just centering the <h3>, I believe it can be solved with display:flex and justify-content:center, goes below: .BlackSky{ background-color: #1C1624; width: 100%; height:…
cssanswered guastallaigor 1,294 -
2
votes1
answer34
viewsA: str_pad returning empty value
Try the code below, I think you just missed you return the values: <?php function ret($valor, $tamanho, $orienta) { if ($orienta == 0){ return str_pad($valor, $tamanho, "0", STR_PAD_LEFT); } else…
phpanswered guastallaigor 1,294 -
1
votes1
answer55
viewsA: Reactivity in event
I started a new project with vue-create and copied your code. Apparently everything is working ok, if I understand correctly. Test with the code below. If there are problems, send me your…
-
1
votes1
answer428
viewsA: Start Vue Project from existing template
I don’t know if I got it right, or if my answer is half dumb, but I think you’re looking for the Vue-cli. If it’s not what you’re looking for, let me know that I delete the answer. According to the…
-
0
votes1
answer253
viewsA: Change card component image
If you just want to change the image according to the state of the mini, there are several ways to accomplish this. Just check which boolean variable is performing the control of this state, and…
vue.jsanswered guastallaigor 1,294 -
0
votes1
answer90
viewsA: Vuejs - How to add e2e/unit tests after not including them initially in the creation of the webpack project?
I found the answer on stackoverflow NA which was answered two days ago on the link:…
-
0
votes1
answer90
viewsQ: Vuejs - How to add e2e/unit tests after not including them initially in the creation of the webpack project?
I own a project that was started with vuetify webpack (Vue init vuetifyjs/webpack). At the time the project was created, the e2e/unit test option was not selected. However, there is now a need to…
-
2
votes2
answers419
viewsQ: Performance types of Eventbus in Vuejs
In some projects I am performing a maintenance, there is the use of Global eventbus. In the case, usually had seen it as follows: Event-bus.js import Vue from 'vue'; const EventBus = new Vue();…
-
1
votes1
answer185
viewsA: How to change position of a table in vuejs
In case, I will carry out the response upon what you said: It was supposed to be like this; I am saying this because the way information is inserted into the table as it stands for the way you want…
html5answered guastallaigor 1,294 -
0
votes2
answers891
viewsA: Assign the return of a function that returns from a Promise
I can’t tell you exactly what mistake might be going on, but I’ll try to help based on what you reported. The first mistake I see is that you have a method getUsers(), but within the method you are…