Vue responsive Observer

During component initialization, the initState method will be executed, which is mainly used to initialize properties such as props, methods, data, computed, watcher, etc. Here we analyze data export function initState (vm: Component) { vm._watchers = [] const opts = vm.$options if (opts.props) initProps(vm, opts.props) if (opts.method ...

Posted by Ludo Lambrechts on Sun, 03 Apr 2022 01:47:11 +0300

Understand and better use Vue3 composition API [setup()]

What is the competition API If you have used vue2, you must be familiar with the Options API. If someone doesn't know what the Options API is, you can see the following code. export default { data(){ return { count: 0; } }, methods: { plus(){ this.count++; } }, computed: { dou(){ return this.cou ...

Posted by nitram on Sat, 02 Apr 2022 20:46:37 +0300

Vue.js front and back end interaction mode

I Front and rear end interaction mode 1.1 interface calling mode Native ajaxajax based on jQueryfetchaxios 1.2 URL address format 1. Traditional URL Format: schema://host:port/path?query#fragment ① schema: protocol. For example, http, https, ftp, etc ② host: domain name or IP address ③ Port: port, http. The default port is 80, which can ...

Posted by jaimitoc30 on Sat, 02 Apr 2022 17:56:34 +0300

Performance optimization of front-end code layer

1. v-if and v-show distinguish usage scenarios difference Means: v-if controls the explicit and implicit of elements by controlling the existence of dom nodes; v-show sets the display style of DOM elements. block is displayed and none is hidden; Compilation process: v-if switching has a process of local compilation / unloading. In the process ...

Posted by trent2800 on Sat, 02 Apr 2022 16:27:07 +0300

vuex understanding and use of vue

vuex is designed for Vue The state management mode of JS application development, with more concepts and frameworks, needs to weigh the short-term and long-term benefits Advantages of vuex: it is convenient to solve the sharing state of multiple components It exists independently of components. All components can use it as a bridge to communica ...

Posted by X74SY on Sat, 02 Apr 2022 14:05:18 +0300

Talk about using Decorator decorators in Vue projects

preface Original intention: in other Vue projects of the company a few days ago, I found that it was developed with Decorator decorator mode. It seems that the overall code is good, so I took notes to share with you. Don't spray it if you don't like it. Suitable for people: primary front-end development, big guys detour. This project is buil ...

Posted by heffym on Sat, 02 Apr 2022 13:07:33 +0300

Vue project (general method + axios customization + http request unified management binding + vue.config.js alias configuration)

catalogue 1,vue.config.js alias configuration and use 2. General method global use (custom plug-in) 3. axios customization 4. http request unified management binding 1,vue.config.js alias configuration and use There is no Vue in the new vue-cli3 project by default config. JS, create a new one in the root directory. By default, the pro ...

Posted by mherr170 on Fri, 01 Apr 2022 22:58:16 +0300

Using vuex and routing guard

catalogue 1. Interface document 2,vuex     2.1 what is vuex? 2.2 why use vuex? 2.3. How to use vuex? 2.4 core concepts 3. Navigation guard (routing guard) 3.1 concept 3.2 global front guard 3.3. Route exclusive guard 1. Interface document 2,vuex     2.1 what is vuex? Vuex , is a program designed for , Vue JS is the stat ...

Posted by bedted on Thu, 31 Mar 2022 18:02:21 +0300

Vue router basic usage

Route, in fact, means to point (the passer-by, the road. The road is the place where people pass through. By, it means to pass through. For example, the only way is the road or place that must be passed), When I click the home button on the page, the content of home will be displayed on the page. If I click the about button on the page, the con ...

Posted by shmick25 on Thu, 31 Mar 2022 11:03:56 +0300

02 vue basic introduction

Getting started with Vue Basics Interpretation of core Keywords: Framework The official positioning of vue is the front-end framework, because it provides a complete set of solutions for building user interfaces (commonly known as vue): vue (Core Library)Vue router (routing scheme)vuex (state management scheme)vue component library (a sch ...

Posted by nvee on Thu, 31 Mar 2022 05:15:27 +0300