Webpack, I think we should all know or have heard that Webpack is a front-end tool that allows each module to be loaded, preprocessed, and packaged. Modern front-end development Many environments rely on webpack construction, such as Vue official recommended to use Webpack. Don't say much, let's get started.First step,
Problem one: The introduction of front-end libraries, the method is not the sameFor example Lodash.js, as a chunk with html-webpack-plugin packaging to the page, will generate a global variable window._, in other JS do not have to require (' Lodash '); You can use Window._ directly.such as Webpack-zepto, as a chunk with html-
Packaging compression JS and CSSSince Webpack itself integrates the UGLIFYJS plug-in (Webpack.optimize.UglifyJsPlugin) to complete the compression of JS and CSS, without referencing additional plugins,Its command webpack -p means calling Uglifyjs to compress the code, and many Webp
CMD jumps to the project's folder, installs the WebpackNPM Install--save-dev WebpackThen you need to PACKJSON.SJ file, all enter off, the default value is OKNPM InitThen install it in the project folder, css-loader andstyle-loader处理样式表NPM Install--save-dev Style-loader css-loaderTo create a new webpack.config.js in the project folder, my content is as followsvar webpack = require (' webpack ') module.export
handshake and wave process, A number of resources to download down, and multiple resources because all are sharing an HTTP request, so the head and other parts are also shared, equivalent to form a scale effect, so that the page display faster, user experience better. ) Vue-cli:vue.js's scaffolding tools. The plain is an automatic help you to build a good project directory, configuration of Webpack, as well as a variety of dependent package tools, t
One, CSS file packaging1. Create a new CSS file under SRC, create a new index.css file under the CSS file, and enter the following codebody{ color:red; Font-size:20px;}2, CSS set up, need to introduce to the import file, where we introduced into the Index.js from ' ./css/index.css ' ;d ocument.write ("It works. ");3. Install Style-loader and Css-loader in terminal4. After installation, we start to configure module options in Webpack.config.js// modules: such as interpreting CSS, how images
can also bind properties with V-bindSummary:
Subcomponents Create a property in props that receives the value passed by the parent component.
Calling subcomponents in parent component
Binding the properties created in subcomponents props in the Subcomponents tab
Assign the value that you want to the child component to this property, such as the MSG of the parent component
Second, subassembly passes data to parent component1, modify the Child.vue as follows:123456789Ten
Public number development call JS-SDK reports: config: invalid url domain error troubleshooting, js-sdkinvalid
1. Check whether the following parameters are correct.
AppId: sAppId, // required. It is the unique identifier of the public account.
Timestamp: sTimestamp, // required. The time stamp for generating the signature.
NonceStr: sNonceStr, // required. A
CKEditor configuration and usage
Ckeditor official website is http://ckeditor.com/, the current version is v3.0.1.
I. Usage:
1. Introduce ckeditor Core File ckeditor. js to the
2. Insert the HTML control where the editor is used
In the ASP. NET environment, server-side controls can also be used.
Add class = "ckeditor" to the control ".
3. Replace the corresponding control with the editor code.
4. Configuration Editor
Ckeditor configurations are
Use of System. Web. Optimization merge compression technology, webpack compression and jsThe principle of bundling and compression is to bind multiple css filesDynamic mergeAndCompressionIs a css file and multiple js files.Dynamic mergeAndCompressionIs a js file, so as to reduce the number of browser requests to server resource files, reduce the size of resource
The front-end of the DVA project development, encountered a very depressed problem, with ES6 syntax simple export a variable out, in other JS import use, the result is an error. The export is written as follows:1 Const Enus = {2account: ' Account : ',3 password: ' Password: ' ,4 userlogin: "User Login"5}; 6 default Enus;It doesn't seem to be a problem, does it? Import is written as follows:1 import Enus from '. /.. /i18n/enus ';It doesn't seem
For example, after I add the following code to the js Code, I don't know why I didn't generate a message according to the official instructions on alert. It is printed only in the console window. Vartimestamp $ ( amp; #039 ;. timestamp #039 ;). val (); varnonceStr $ ( amp; #039 ;. noncestr #039 ;). val (); varsignature...
For example, after I add the following code to the js Code, I don't know why I didn'
, allows the browser to cache for 86,400 seconds (1 days), and must also set the varybyparam= "None" attribute, which indicates that multiple versions of the page do not require a separate cache.You can also set it programmatically, either in the post code or in the HttpModule:
void Setcache (){This. Response.Cache.SetExpires (DateTime.Now.AddDays (1));//Can be ignoredTimespane ds = new Timespane (1,0,0,0);This. Response.Cache.SetMaxage (DS);//Key code}
Using Cache ConfigurationCon
1, note that this case does not support IE6, and finally with the support of CSS3 browser view, can be used in the IFRAME framework, you can cover the entire frame
2, Alert pop-up box effect chart
3, config pop-up box effect chart
4, if use this framework inside, must import 3 files in the framework of a jquery package, one is the implementation of the effect of JS file,
By default, IIS does not support parsing. json files, which requires our own configuration under IISMethod One: IIS configuration1. Click on the Start menu to select Control Panel;2. In the Control Panel, click Administration Tools, select Internet Information Services (IIS) Manager..3. Click MIME type4. Click "Add ..." in the action.File extension:. jsonMIME type: Application/json..Click on "Handler Mappings"In action Select "Add script Map"The request path is: *.json,Executable file: C:\WINDOW
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.