vue components from development to publication

Componentization is a very important part of front-end development. Decoupling from business can improve the code reuse rate of the project. More importantly, we can pack and distribute. As the saying goes, the collective power is great, because there are so many open source contributors, we have the world today. Engineers who ...

Posted by UrbanCondor on Sat, 02 Feb 2019 15:00:15 -0800

Basic grammar of vue

Basic grammar of vue 1. Template grammar 1.1 Mustache grammar {{msg}} //Getting the value of msg variable in data in html 1.2 Html assignment v-html="" //Output content as an html tag. html() is similar 1.3 Binding Properties v-bind:id="" //attr() is similar 1.4 expression {{1?'Success':'Failure'} // Trinomial Operation ...

Posted by ntohky14 on Sat, 02 Feb 2019 14:51:15 -0800

Native javascript implementation magnifier

The effect is as follows Knowledge Points Used offsetTop property: This attribute can get the distance between the upper and outer edges of the element and the nearest location of the inner wall of the parent element. If the location is not used in the parent element, the distance between the upper and outer edges of the e ...

Posted by cjacks on Sat, 02 Feb 2019 11:21:16 -0800

ArcGIS API for JS Map Printing

In a recent project, there is a functional requirement for map printing, which outputs map base maps and overlapping layer services to image preservation. There are usually two ways to implement this function. One is to use the PrintTask interface provided by ArcGIS API For JS.( https://developers.arcgis.com/javascript/3/jssam ...

Posted by gromer on Sat, 02 Feb 2019 10:33:15 -0800

vue project implements three ways of on-demand loading: vue asynchronous components, import() of es proposal, and require.ensure() of webpack.

1. vue asynchronous component technology vue-router configures routing, using vue's Asynchronous component The technology can realize on-demand loading. However, in this case, the next component generates a js file. Examples are as follows: { path: '/promisedemo', name: 'PromiseDemo', ...

Posted by thor erik on Sat, 02 Feb 2019 00:57:16 -0800

JS sets cookies and deletes cookies

There are many ways to set cookie s in js. The first one is: (This is the code of w3c official website) <script> //Set cookie function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); var expires = "expires="+d.toUTCString(); document.cookie = cnam ...

Posted by Duell on Fri, 01 Feb 2019 09:45:16 -0800

Three Binding Methods for Click Events

Using onclick attributes in HTML Using onclick attributes in JS JS uses the addEvenListener() method Comparison of three methods In the second and third methods, an event object can be passed into the function and its corresponding attributes can be read, but none of the methods can. Grammatical details In the first met ...

Posted by edup_pt on Fri, 01 Feb 2019 02:06:15 -0800

vue encapsulation common method to deal with the accuracy of js computational scientific notation

Statement: The core of this article is to refer to other Daniel's articles or blogs earlier. The source of this article can not be found. If you see it, please leave a message, it will make up the source. Make some changes and keep them in use. Not much nonsense, here's how to use the code in vue directly: 1. New public metho ...

Posted by nsr500rossi on Fri, 01 Feb 2019 00:36:15 -0800

Data deconstruction

1. Add the two arrays returned from the background (the length of the two arrays is equal) and add the corresponding items in turn. Business scenarios: The backstage of the `recharge amount'field has not returned. We need the front end to add the corresponding items of the other returned arrays in turn. /** * @rechargeAmou ...

Posted by JasonTC on Thu, 31 Jan 2019 23:33:15 -0800

Angular JS directive to write a paging

Framework: angularjs +angula-material Background: The paging style provided by angular JS material does not meet the needs of the project, and needs to customize the paging style. As shown in the figure: Added Home / Last Page, Last Page / Next Page, More Pages. html: <paging class="table-page" layout="row" layout ...

Posted by NottaGuru on Thu, 31 Jan 2019 21:36:15 -0800