Posts by haykou • 3,602 points
126 posts
- 
		1 votes1 answer652 viewsQ: How to "type" nested objects? (Typescript)I have the following example object: const types: any = { car: { full: 'fullString', empty: 'emptyString' }, plane: 'myString', }; I’m trying to get a guy on types but the nested object (car), He… 
- 
		2 votes0 answers32 viewsQ: Is it possible to change the text of the "Add to home screen" prompt of a PWA?Is there any way to exchange the text "Add to home screen" of a PWA? I figured it was by manifest PWA, however I found no specification, I have seen in some sites this text in Portuguese, there is… 
- 
		9 votes1 answer390 viewsQ: What is the difference between Local Storage, Indexeddb and Websql?I have a habit of using Local Storage to store JWT, I would like to know the difference between Local Storage, Indexeddb and Websql and when to use one or the other. 
- 
		2 votes0 answers45 viewsQ: How to simulate a click function on an HTML file using Jest?I’m starting to create tests for a simple HTML page, it has a script with some functions and my idea is to test these functions. But I can’t simulate a click on the DOM inside my test, how can I do… 
- 
		2 votes1 answer303 viewsQ: Vue.js: how to change a $state of Vuex that is in a v-model?I am with the following doubt, I have some inputs linked to Vuex states: <input class="form-control" type="search" placeholder="Filtre sua pesquisa"… 
- 
		7 votes1 answer1265 viewsQ: What is "Prop Drilling"?I believe the term is related to passing properties between various components, but I don’t understand exactly. What is "Prop Drilling"? How to avoid it? It is a common practice? 
- 
		4 votes1 answer92 viewsQ: What are Renderless Components?What exactly is the utility of a Renderless component? Is there any real advantage to its use? 
- 
		2 votes0 answers85 viewsQ: PWA: How to save an offline POST and fire it when the application is online?From what I saw it is possible to cache GET requests / service Workers so that they are triggered when the application comes back online. It is possible to do the same functionality with a POST? Is… 
- 
		3 votes1 answer116 viewsQ: How to transform an array recursively?I have the following array: let exemplo = [{ alarm: { title: "Pai", id: "1" }, children: [], parent: "", }, { alarm: { title: "Filho", id: "2", }, parent: "Pai", children: [], }, { alarm: { title:… 
- 
		1 votes2 answers75 viewsQ: How to modify an object array through a condition?I have the following object array: let items = [ { carro: { title: "Gol", description: "Gol quadrado", active: true, }, isVisible: true, }, { carro: { title: "Gol Filho", description: "Gol… 
- 
		2 votes2 answers107 viewsQ: Vue.js: how to relate values in an array of strings?I have the following problem, I have an array of strings that assembles a list: ex: op: ['100', '101', '102', '103', '104', '200', '201', '202', '300', '301', '303', '500'] From that list, I create… 
- 
		2 votes2 answers1584 viewsQ: What are http-equiv="Pragma" and http-equiv="Cache-Control" goals for?I am using the W3C validator in an old project and it identified some errors in the following goals: <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta… 
- 
		5 votes1 answer218 viewsQ: What is the purpose of the nextTick() method?I used the method nextTick() sometimes, especially when I need to change something in the DOM, however, I don’t understand exactly what its purpose is. Can anyone give me examples of their right… 
- 
		3 votes1 answer433 viewsQ: Git: What are the possible streams for two development environments?I’m setting up a development environment with Git in some of my projects, my initial idea for simple projects is: The master branch is blocked when someone needs to perform change is created a new… 
- 
		3 votes1 answer136 viewsQ: How to perform a "back" Transition using Vue Router?I’m making a simple transition in a webapp (using Animate.css), where the user clicks on a button and the current component leaves the screen on the left and the other component comes from right to… 
- 
		1 votes1 answer573 viewsQ: How to filter an object array using other object array?I am trying to create a filter of recent products that are searched (when starting to type, it already appears the products found, as if it were a "like"), I have a global variable that is an array,… 
- 
		1 votes2 answers2045 viewsQ: Vue.js: How to format a value in a v-model?I have the following problem, I need to format an input value, directly when the user is filling the field (@keypress or @input). When I use the method to format outside the input it works, but if I… 
- 
		5 votes2 answers109 viewsQ: How to return to the previous state? (Vuex)I am using Vuex to manage the states of my app and I am creating a forward button and a back, in case of my advance I use the function below: addUser() { const payload = { name: this.name, email:… 
- 
		1 votes0 answers54 viewsQ: How to change a meta tag in a SPA?I have a SPA made with pure javascript, and I needed to change the meta Description after an event, for example, a click. Using javascript I can change, but I believe that for Google’s Crawler it… 
- 
		3 votes1 answer94 viewsQ: What is callback server-to-server?I wonder if it is a concept, I am using a service that informed me that information can be obtained via callback server-to-server, but I did not understand exactly the meaning of the term. 
- 
		2 votes2 answers896 viewsQ: What is the difference between Htmlcollection, Nodelist and Object?Sometimes I have to manipulate a Nodelist, another one Object but I didn’t understand exactly what the difference is between them. And what the GIFT with them?… 
- 
		1 votes0 answers38 viewsQ: How to replace html tags and save to a new fileI’m trying to check a file .html, remove some tags and create a new file with the changes made. In the method that I am using at the moment (js, Gulp) I end up doing several Restplaces in chain, I… 
- 
		4 votes2 answers861 viewsQ: What is the difference between :Nth-Child and :Nth-of-type?Most of the time I use the :Nth-of-type but I didn’t understand exactly the difference between the two, someone can explain? 
- 
		1 votes2 answers63 viewsQ: How to apply two validations at the same time?I am trying to create a simple validation of two fields, where I only check whether there is a value or not, but the second if only runs after the first one is checked. I wanted the two of them to… 
- 
		1 votes1 answer318 viewsQ: How to make a each inside an append?I’m trying to create a Jquery plugin but I can’t adapt a . each into a . append, how can I use it to work inside the . append? Follow my example below: var selectBox = $('.select__atual'); var… 
- 
		7 votes2 answers565 viewsA: Why doesn’t Firefox display WEBP images?Why does Firefox not render WEBP images? No support? A: Yes, no support. Which browsers have support? WEBP is only experimental (this question needs to be answered considering that we are in the… 
- 
		0 votes1 answer102 viewsQ: How to save inline style in a variable?I need to assign to some variable the inline style of a div, before it is modified: The example below is what I hope will happen, but I cannot force 'top', '100px' on the second button and recover… 
- 
		9 votes2 answers3332 viewsQ: Preload, Prefetch and Preconnect, what are they for?I see in several sites these values Preload, Prefetch and preconnect in the attr rel of certain links, but I did not understand exactly its functionality. What exactly are they for? When to use?… 
- 
		2 votes1 answer139 viewsQ: Vuejs: is it possible to know which was the last object changed?I have the following problem, I need the functionality of "back" in a button, if I am in the foot2 when I click I go back to the foot1 and from the foot3 to the foot2, it is possible to pick up the… 
- 
		0 votes2 answers386 viewsQ: How to check if an object has a string?I have the following problem, I need to check if an object has a certain string, this object comes from the google Places API autocomplete. This is a return json, for example: {… 
- 
		1 votes0 answers286 viewsQ: Vuejs: how to pass data from one array to another array?I have the following problem: I have two separate lists and need to pass the selected data (checkbox) to the other list by removing the selected item and placing it in the other list (along with its… 
- 
		0 votes1 answer229 viewsQ: Thymeleaf: how to insert one include inside another include?I’m including a footer as follows in my home: <div th:replace="footer :: footer"></div> And inside the footer I need to include some overlays: <div… 
- 
		7 votes1 answer761 viewsQ: Vuejs: how to check all checks and count your quantity?The problem is this: I have several lists with a title, where it serves as a "select all" but it should select only the checkboxes that are your "brothers". But I can’t check them in the "select… 
- 
		1 votes1 answer309 viewsQ: Vuejs: How to access data from a v-for within a method?I have the following problem, I need to manipulate some variables that are in my date, through a click, which is within a list (v-for). But I can only create the condition directly inside the click,… 
- 
		15 votes2 answers5966 viewsQ: What are the differences between npm and Yarn?I’m thinking of migrating from npm to the Yarn, can anyone tell me what the main differences? Is there any considerable benefit between the two? 
- 
		0 votes2 answers674 viewsA: Vuejs: how to create a condition for a v-model?I solved my problem like this, I created a Watcher to keep watching the variable slcModalidad and made a Vertification inside it: watch: { slcModalidad: function(){ if(this.slcModalidad > 1){… 
- 
		4 votes2 answers674 viewsQ: Vuejs: how to create a condition for a v-model?The problem is, I have a switch made with label and input checkbox and it has a default value that comes from date of my instance of Vue. var app = new Vue({ el: '#app', data: { slcModalidad: 0,… 
- 
		5 votes1 answer725 viewsQ: Vuejs: how to create a condition from one v-for to anotherMy problem is the following, I have two separate options boxes, where the list of the first box is loaded through a json. And I need to load the second box of options depending on the value selected… 
- 
		4 votes2 answers81 viewsA: Step made with cssThere are several methods of doing this, I believe that this is the simplest, using a triangle at the end of each line to simulate a step. Follow the example code with two: .chao1{ width:50%;… 
- 
		5 votes1 answer132 viewsQ: How does v-if work internally?From what I’ve seen, using the v-if it is possible to show and hide an element through a condition, but it does not function as a toggle of Jquery, the v-if ends up removing the element and can… 
- 
		0 votes3 answers154 viewsA: Javascript remove() does not workFrom what I’ve seen your code is correct but missing the correct element in the remove, follows an example of what you are doing below: <div id="app"> <div class="teste"></div>… 
- 
		2 votes1 answer941 viewsA: Change page content when clicking on link in VuejsYou can hide and show the blocks according to the place you are selecting or make a route system, in the case of Vue, use the Vue-router A simple example of how to hide/show blocks can be as… 
- 
		0 votes2 answers480 viewsA: Aligning Counter on IconI believe it’s just the CSS, add a relative in to which is encompassing the spans and square with quantity using the Absolute. a{ position:relative; } .label{ position:absolute; top:-15px;… 
- 
		2 votes1 answer323 viewsQ: How to force recaptcha to expire your session?I am trying to make modifications with the recaptcha expiration message, but I can’t see it (occasionally if I leave a tab open, it appears), there is some way to force the recaptcha expiration… 
- 
		2 votes3 answers1147 viewsQ: What is the difference between . on('input') / . on('Paste') / . on('change')?I was trying to do a validation but with the .on('input') it works better than the .on('Paste') (I needed to put a timeout to make it work), can anyone explain to me the difference between the two?… 
- 
		0 votes1 answer92 viewsQ: Flexbox: Is it possible to control the amount of items aligned with "space-between"?I have the following case, a father div with 5 daughter Ivs, and I need them to line up two by two using the space-between in the father div: .pai{ display: flex; justify-content: space-between;… 
- 
		2 votes1 answer439 viewsQ: Flexbox: Is it possible to force 100% wide on a daughter div with space-between on the father?I have the following problem, I have a div parent encompassing three elements, and she has css: .pai{ display:flex; justify-content:space-between; width:400px; } But I wanted the first daughter to… 
- 
		1 votes0 answers345 viewsQ: How to block special characters coming from a "Paste"?I have the following problem, there is a validation being made that way: $(document).ready(function(){ $(this).on("paste", "#email", function(event) { var $obj = $(this); setTimeout(function() { var… 
- 
		1 votes3 answers2145 viewsQ: Vuejs: Is it possible to use a condition to enable a @click?I have a disabled button, which depends on other fields to get enabled: <button class="actAplicarTodosFiltros" disabled="disabled">Aplicar</button> So I have tabs that make some changes… 
- 
		1 votes2 answers1592 viewsQ: Vuejs: How to share data from one component to another?I have two separate components and need that when clicking on a button, it modifies the variable of another component. For example I have the following component: var componenteFiltroBusca = new…