Nuxt.js ajax operation of programmer's necessary programming

Nuxt.js(4) ajax operation for programmers 1, Integrate axiox When building a project, if you select the axios component, nuxt.js will automatically integrate with axios. Integration effect:   1) package.json has axios version   2) nuxt.config.js add axios as a module   Common configuration, modify nuxt.config.js to config ...

Posted by --ss-- on Sun, 22 Mar 2020 08:37:51 -0700

React Hook + TS shopping cart practice (performance optimization, closure trap, custom hook) - Zhihu

Preface This article is based on a basic shopping cart demand, step by step, to give you a deep understanding of the pit and Optimization in React Hook You can learn from this article: A kind of Practice of writing business components with React Hook + TypeScript A kind of How to use React.memo to optimize performance A kind of ...

Posted by Karamja on Fri, 20 Mar 2020 13:28:36 -0700

Nuxt.js (view, axios operation, plug-in)

3. view 3.1 default layout ~/layouts/default.vue 3.2 custom layout Step 1: create a file under the ~ / layouts folder ~/layouts/blog.vue Note that there must be a < / nuxt > tag, which is equivalent to the < / router View > you learned before Step 2: introduce in the page If not imported, the default layout is used by defa ...

Posted by david4u on Wed, 18 Mar 2020 06:19:12 -0700

Vue's Axios Cross-domain Problem Solutions

// GET requests in axios axios.get('/user', { params: { ID: '001' } }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }); // POST requests in axios axios.post('/user', { firstName: '1', lastName: '2' }) .then(function (response) { console.log( ...

Posted by elle_girl on Tue, 10 Mar 2020 16:14:44 -0700

4: Front and back interaction of Vue

1: Overview 1 interface call mode Native ajax ajax based on jQuery fetch axios 2: Traditional URL Format: Schema: / / lost: port / path? Query fragment 1):schema: protocol. For example, http,https,ftp, etc 2);host: domain name or IP address 3):port: port, http default port 80, can be omitted ...

Posted by viveleroi0 on Mon, 09 Mar 2020 21:59:10 -0700

Quickly grasp the relationship between ES6 iterator Generator and async and its usage

1. Traverser iterator 1.1 for traversal First of all, how do you traverse an array when you first get out of js? var arr = [1, 2, 3, 4, 7, 8, 9] for (let i = 0;i < arr.length;i++) { console.log(arr[i]); } 1.2 forEach traversal It looks like a dumb bunch, so ES5 has studied a foreach method for you, but it can't break, change t ...

Posted by scottjcampbell on Thu, 05 Mar 2020 08:44:54 -0800

vue page parameter $route edit Preview

List page 1. Page section <el-table :data="testpage.slice((currentPage-1)*pagesize,currentPage*pagesize)" border style="width: 100%" >     <el-table-column prop="id" :inputValue="msg" label="ID" width="180"></el-table-column>     <el-table-column prop="title" label="Title"></el-table-column>     ...

Posted by ucbones on Sat, 15 Feb 2020 06:50:44 -0800

Dynamic load user menu

The process is that the user enters the module page after logging in, clicks on different modules, and enters the menu page (different modules, different menu contents) Problems encountered 1. The menu data is stored in the store and the page is blank after refreshing Solution: initialize the menu every time in the global navigation guard ...

Posted by vandalite on Wed, 12 Feb 2020 07:16:43 -0800

axios in vue

axios promise based on http client for browser and nodejs characteristic Browser side initiates XMLHttpRequests request http request from node Support Promise API Listen for requests and returns Conversion request and return Cancellation request Automatically convert json data Client support mitigation install Using npm: npm install axios -- ...

Posted by mjahkoh on Fri, 07 Feb 2020 10:38:51 -0800

Redux information perfect interaction

Interaction requirements: improve the background interaction of information page, redux sends update data request to realize asynchronous update of user data of state tree, detects whether information supplement has been completed each time when entering the perfect information page, if it has been completed, directly jump to t ...

Posted by fooDigi on Fri, 31 Jan 2020 15:22:15 -0800