vue adapts to the mobile terminal, with the help of px 2 rem plug-in, it is convenient to convert px units to rem

1, installation npm install px2rem-loader lib-flexible –save 2. Introducing lib-flexe into the project entry file main.js import 'lib-flexible/flexible.js' 3. In utils.js under build, find the generateLoaders method and add it here. const px2remLoader = { loader: 'px2rem-loader', options: { ' ...

Posted by piyush23424 on Wed, 06 Feb 2019 22:21:16 -0800

Event modifiers for VUE, once,prevent,stop, capture,self,passive

Once, execute only once <div v-on:click.once='alert("1")'></div> Only when the first click is executed, clicking again won't work. 2. prevent Prevent default programs, such as the summit submit button in the form, from submitting themselves. <form v-on:submit="alert('who')" action="first_submit" met ...

Posted by cpace1983 on Tue, 05 Feb 2019 03:27:17 -0800

Solution to Module build failed: TypeError: this._init is not a function error when using vue

It's no longer allowed to omit the '-loader' suffix when using loaders This is the first bug I encountered in learning vue2. I checked the documents on the internet. They all said that adding the suffix of - loader is enough, but it still hasn't been solved. I found the God and finally solved the problem and shared it with you ...

Posted by napier_matt on Mon, 04 Feb 2019 17:27:16 -0800

VUE Learning Path (2) - - Vue.directive of Global API

One. Global API: APIA global is not in the constructor, but declares global variables first or defines some new functions directly on VUE. VUE has built-in global APII, such as Vue.directive. Simply put, we define new functions with API functions provided by Vue outside the constructor. Two. Vue.directive 1. Let's make a sma ...

Posted by silviuchingaru on Mon, 04 Feb 2019 06:03:16 -0800

Basic styles commonly used in vue projects (reset.css and border.css)

reset.css Different browsers often display the same label differently, so when doing a project, we need to set the basic style to achieve the same display effect in different browsers. This is the role of reset.css. All, it is necessary for you to collect it and use it directly when you are doing the project. Specific code: ...

Posted by mrjonnytou on Mon, 04 Feb 2019 00:24:16 -0800

vue-31-animation-animation using hook function (half-field animation uses this)

Hook function animation Setting meaning of starting animation (same as ending animation) v-on:before-enter indicates that the animation has not yet started before the animation enters, in which you can set the starting style of the element before the animation begins. v-on:enter represents the animation, and the style after ...

Posted by andyg2 on Sun, 03 Feb 2019 12:36:16 -0800

vue.js and vue-waterfall-easy realize waterfall flow + drop-down refresh

vue.js and vue-waterfall-easy realize waterfall flow + drop-down refresh Recent project requirements first need waterfall flow, then need drop-down refresh function. I thought it would be easy to achieve this effect through vue-waterfall-easy and then use drop-down refresh in other ui libraries. But this is not the case. After ...

Posted by rehfeld on Sat, 02 Feb 2019 17:48:15 -0800

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

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