20 JavaScript single line code killer maces
Gets the value of the browser Cookie
Retrieve the value of the cookie by using document.cookie access.
const cookie = name => `; ${document.cookie}`.split(`; ${name}=`).pop().split(';').shift();
cookie('_ga');
// Result: "GA1.2.1929736587.1601974046"
Convert RGB to hexadecimal
const rgbToHex = (r, g, b) =>
"#" + ((1 << 24 ...
Posted by RP on Wed, 10 Nov 2021 03:18:40 -0800
setup function in Vue3 and response expression ref reactive
In the previous article, Xiaobian and everyone learned the basic syntax and concepts of Vue, including components, data mixing and slots. Starting today, Xiaobian will learn the new features in Vue3, that is, the overwhelming composition API fried online, to see what the magic is. The code we wrote through Vue is basically like this
Vue.create ...
Posted by lee2732 on Tue, 09 Nov 2021 22:48:14 -0800
3D shuttle effect? Easy to handle with CSS
backgroundI habitually log in to Apex at home at the weekend and prepare to play some games. In the process of landing the accelerator, it was found that the accelerator expired.I have been using Tencent online game accelerator, but click the recharge button to prompt that the client has been upgraded recently and does not support recharge (thi ...
Posted by doni49 on Tue, 09 Nov 2021 21:56:50 -0800
Vue concise and practical tutorial (04) - event handling
Copyright notice
Original author: brother Gu's younger brotherAuthor blog address: http://blog.csdn.net/lfdfhl
Event handling overview
In Vue, it is very convenient to handle events, such as click events, mouse over events, etc.
Main steps:
1. Define the function in the methods of the Vue instance.2. Specify the event type and its corres ...
Posted by JCScoobyRS on Tue, 09 Nov 2021 16:27:09 -0800
Summary of knowledge points of ecarts data visualization
Knowledge points of ecarts data visualization (I)
1. Use steps
(1) Import the echorts.js file
(2) Prepare a box to present the chart
(3) Initialize the ecarts instance object (parameters, dom elements, which determine the final rendering position of the chart)
var mCharts = echarts.init(document.querySelector('div'))
(4) Prepare configur ...
Posted by nagasea on Tue, 09 Nov 2021 14:21:01 -0800
Vue learning - preliminary understanding
Vue learning (I) - preliminary understanding
Source: PC personal blog
1. Front rear relationship
Vue is a progressive framework for building user interfaces, which can be applied layer by layer from bottom to topMVVM mode
Model: model layer, representing jsView: view layer, DOMViewModel: middleware connecting views and data. Vue.js is t ...
Posted by mcl on Tue, 09 Nov 2021 13:53:59 -0800
The usage of this.$set in Vue can be used to modify an object in the array of objects and update data to the view
The moon at night, thinking of those who missprefaceRecently, I'm writing about the vue project arranged by the teacher. To tell the truth, I really jump across Baidu, google, bing and other search engines repeatedly every day. Otherwise, I'll search the Nuggets, think about it, and have a look at CSDN. My front-end grew up eating a hundred mea ...
Posted by Usagi on Tue, 09 Nov 2021 09:45:13 -0800
Ideas for designing high performance react components
For a high-performance react component, it is important to reduce redrawing and rearrangement, server rendering, and so on.
In a react application, the logic is organized as a react component, which splits the UI into separate, reusable components. Then the component performance optimization is maliciously considered from the perspective of co ...
Posted by ehhwan on Tue, 09 Nov 2021 08:38:34 -0800
Promise static method summary
Promise.resolve
The Promise.resolve() method returns a promise object parsed with the given value. If the value is a promise, the promise will be returned; If the value is thenable (i.e. with "then" method), the returned promise will "follow" the thenable object and adopt its final state.
const thenable = {
then(onFullfi ...
Posted by pabs1983 on Tue, 09 Nov 2021 04:05:52 -0800
The text effect realized by pure CSS can be so cool
Hello, I'm the senior brother of the front-end laboratory!
preface
CSS is a very special language. You think CSS can only be used to control the structure and style of web pages, but as long as you have rich imagination, you can create unlimited possibilities.
In this article, senior brother has selected 10 cool text effects implemented wi ...
Posted by Aeolus on Mon, 08 Nov 2021 19:25:48 -0800