In the Vue single page application, we will probably use the Commonschunkplugin plugin. Portal CommonschunkpluginHowever, in the project after the local testing without any problems, packaging on-line will be error WEBPACKJSONP is not defined. This is because the public file must be referenced before the JS file that you reference.File references can be changed m
Always think Angularjs and Vue are like, today in the limit load the number of data bar found its different, say not much, directly look at the code:1.angularjs2.vuedataList " v-if= "indexAngularjs with the Vue Loop array object is the difference
There was a problem installing json-server today, and the build file did not generate a dev-server.js file.Start is suspected configuration has a problem, or is not installed correctly, then reinstalled two or three times, or so, depressed.By querying the information, the new version of the VUE-CLI canceled Dev-server.js and dev-client.js instead of webpack.dev.c
The web page is printed as a pdf instance code in vue, vuepdf
Sort out the document, find a vue, print the web page into pdf code, and sort it out and share it with you.
Need to introduce
html2canvas.js'
And
jsPdf.debug.js
These two plug-in libraries can be easily accessed by Baidu. If an error is reported during esli
After the vue finishes rendering the page, the div's scroll bar is kept at the bottom of the method, vuediv
Example:
// After each page rendering, the scroll bar at the bottom of the updated: function () {this. $ nextTick (function () {var div = document. getElementById ('Dialogue _ box'); div. scrollTop = div. scrollHeight ;})}
// After the first page rendering, the scroll bar
Recently in learning how to write a project Vue, after stepping on a lot of pits, finally to the last step npm run build, very happy to wait for the miracle, and then after the packaging has not found the picture path problem.Workaround: 1. Place the picture or JSON data file folder in the static folders so that the Webpack will be packaged automatically when packaged2. Locate the Utils.js file under the Build folder, modify the path to the static res
("Options")) { Httputil.setresponse (response, HttpStatus.OK.value (), null); return; }The above code needs to be added to the allowed headers, Content-type and Access-token, and when judging the request method is options, return OK (200) to the client, in order to continue to send a formal post request.The POST request was successfully made after the modification.In the request header to pass what parameters, it
type, also can not write, write to specify the download file format, do not write, what file format, download is what format, according to project needs.
suffix-name MIME name*.3GPP AUDIO/3GPP, VIDEO/3GPP*.AC3 AUDIO/AC3*.ASF allpication/vnd.ms-asf*.au Audio/basic*.css Text/css*.csv Text/csv*.doc Application/msword*.dot Application/msword*.DTD APPLICATION/XML-DTD*.DWG IMAGE/VND.DWG*.DXF IMAGE/VND.DXF*.gif Image/gif*.htm text/html*.html text/html*.
The Select drop-down box does not have an optional grayOneHtmlclass="Sale"> Select@change ="Getcountydata ()"> for="(Item,index) in data":d isabled="Item.is_true==1?true:false":class="{statusbtn:item.is_true==1}">{{item.is_true}}Select>TwoScriptdefault { ' app', data () { return {"Data": [{"Is_true": "0","region_id": "12","Region_name": "Nanchang",},{"Is_true": "1","region_id": "13","Region_name": "Jingdezhen",},{"Is_true": "0","region_id": "14","Region_name": "Pingxia
Today in the project has been quite normal, I have a little break back to report this mistake, I Baidu has not found a half-day answer. Then I can only reinstall VUE-CLI, the miracle has been wrong No, then I took a break and found that there was an error. The gas blew all over.Words do not say a lot directly.Solve the problem of error.Until I found this. So much so that I publish this article late at night, it is
This is done because a JS file needs to be introduced inside a component to locate it. If put in index.html, so each component will have this JS. So it needs to be introduced separately within the component.The first operation of the DOM introduces JS:default { mounted () { const s = document.createelement ('script'); 'text/javascript'; ' Https://g.alicdn.com/dingding/dinglogin/0.0.2/ddLogin.js ' ; Document.body.appendChild (s); },}The
case, the route is there, click the tab can also be a corresponding switch, but generally we need to click on the bottom of the first page of the tab to let Zi Lu by default and load the data, in order to enter the page let the first sub-route is selected, you can add a redirect to the main route properties, Point the path to the appropriate sub-route.
{
path: '/* ',
name: '
Using @import to introduce external CSS, the scope is globalTemplate>template>script> export default {name: "user"};script>style Scoped>@import ". /static/css/user.css "; .user-content{background-color: #3982e5;} STYLE>
Add "scoped" attribute to limit CSS
to this component only
This sentence everyone should be seen more, I also use scoped, but using @import to introduce external style sheet scope
A few days ago in the process of work, in the data rendering, the swiper that part of the Carousel diagram is not scrolling, manual swipe also has no effect. Always feel the data start rendering, is not the data rendering time, and did not generate Swiper node it. Then the first feeling is to put the control swiper rotation function in the initialization event,Pu
Problem:
Is the variable that I assigned to data in the interface, and then the effect of the component doesn't come out (my rotation effect)
The code is as follows:
Data () {return
{
slides: []
}
},
Mounted () {
this.request ()
},
methods: {
request () {this
. $http. Post (' Xxxxxxxxxxxx ', {},
Res) => {
if (Is.object (res)) {
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.