Set global variables or data methods in vue, vue global variables
Example:
Const MyPlugin = {// the install method is required. // it contains two parameters: Vue constructor and an optional option object install (Vue, options) {Vue. prototype. test = "test";
A project created by vue-cli, how to configure multiple pages, and how to create vue-cli
Vue-cli, a command line tool officially provided by vue, allows you to quickly build a single-page application. Indexing index.html on a page is not complicated if we need to configure multiple pages.
Assume that the page to be cre
Vue implements the method of prompting to save and exit, and vue implements the SAVE and exit method.
Assume that you need to edit the text on a page, but do not click Save and jump to the next route. A better way is to give a prompt-"Your edited content has not been saved. Are you sure you want to exit ?" If you click "OK", exit without saving the current content. If you click "cancel", cancel the route ju
When using Vue.js to do the project, a page is composed of several components, so in the jump page, and not suitable for the traditional href, so vue-router came into being.
Official documents: https://router.vuejs.org/zh-cn/essentials/getting-started.html
have a lot of friends to find me to demo, but the blog in this case was I deleted, I had to write a super simple demo, hoping to help
Link: Http://pan.baidu.com/s/1nvqfA1V Password: 79BV
This time
Use of Vue-router in vue. js (vue-router) vue:
How to configure main. js (es6): Remember the vue required by npm before referencing
Import Vue from 'vue 'import App from '. /App.
Let's talk about the transition effect of Vue. js and the transition effect of Vue. js.
With the transition system of Vue. js, you can easily add transition animation effects to the process of DOM node insertion/removal. Vue will Add/Remove CSS class names at the right time to trigger CSS 3 transition/animation effects
Summary of ultra-comprehensive use of vue. js and summary of vue. js
I. Vue. js Components
Use vue. js build Components
Vue.component('componentName',{ /*component*/ });
Note that the component must be registered before use, that is:
Vue.component('mine',{ template:'#mineTpl', props:['name','title','city','content']
Vue. js computing attributes computed and $ watch, vue. jscomputed
Binding expressions in a template is very convenient, but they are only used for simple operations. The template is used to describe the view structure. Adding too many logic in the template will make the template too heavy and difficult to maintain. This is why Vue. js limits the binding expressi
Vue-based website front-end permission management (frontend and backend separation practices) and vue permission management
As a popular language, Javascript is widely used. It can be seen everywhere from the front-end to the back-end, this technology is also widely used in our project to develop front-end pages such as CMS and other data analysis systems, for this reason, I am very interested in and use it
Vue. js implements data pulling and updating using custom commands. vue. js customizes data pulling and updating.
Preface
The code snippet of this article is located in the single file component of vue, that is. in the file at the end of vue, this article describes only one implementation method. It is neither the only
A deep understanding of the principles of Vue one-way data streams and a deep understanding of vue data streams
What is one-way data stream?
One-way data streams can only modify the status in one direction. It is a simple example of unidirectional data streams:
Simple diagram of one-way data stream
A unidirectional data stream corresponds to a bidirectional data stream (also called bidirectional binding ).
When you use vue-router in vue to switch the page, the scroll bar will automatically scroll to the top of the page, vuevue-router
Sometimes we need to scroll the page scroll to a fixed position.Window scrollTo() Method.
Syntax:scrollTo(xpos,ypos)
Xpos: required. X coordinate of the document to be displayed in the upper left corner of the document display area.
Ypos: required. Y coordinate of the document to
Vue. js custom command usage and instance parsing, vue. js Parsing
Most of the Articles on Vue. js custom commands on the market talk about syntax and seldom talk about actual application scenarios and use cases. Even if you understand how to write them, you do not know how to use them. This document does not describe the syntax. It describes the usage of custom
Use the Compass method in Vue, and use the compass method in vue.
Motivation
After a long delay, I finally made up my mind to write my own personal websites. Not only do I have to look so cool, but I also need to be OK with technology, so take this opportunity to exercise your unfamiliar technologies. The website plans to use Vue as the front-end framework, and C
Describes the sequence of vue functions and vue functions.
Method is used to define the method. For example, if you @ click = "test", methods defines the test method.
Both created and ready are the lifecycles of vue components.
Created
Type: Function
Details:
It is synchronously called after the instance is created. At this time, the instance resolution opt
1. Installing the NODEJS EnvironmentDownload node. js. After the installation is successful, the console input node-v the version number, and the installation is successful.If the version number does not appear, but the node is not an internal command, you need to configure the environment variable, if the version number has occurred, this step can be ignored. Cut the path where node is installed, right--My computer--and the Advanced system environment settings--environment variables--Find the P
Recently in the study of Vue, and then did a small back-office management system used to practiced hand, the development process, the thought of cutting pictures to upload the user avatar needs. Internet Baidu, found a lot of use is vue-cropper. I also use, personal feeling is very useful. Now here's a simple demo to show you how to use Vue-cropper.Where the user
Vue-meta-info:Installation:NPM Install Vue-meta-info--saveGlobal introduction of Vue-meta-info, in Main.jsImport vue from ' Vue 'Import metainfo from ' Vue-meta-info 'Vue.use (MetaInfo)Static use of metainfo in componentsIf your t
Vue-awesome-swiper
Vue-awesome-swiper Resource address: Carousel map GitHub
swiper2.x official use of documents: Swiper2 official documentation API
Documentation for all configurations: swiper3.x configuration Document
Use:
1. First NPM install dependent (I use 2.6.7 version)
NPM Install vue-awesome-swiper@2.6.7--save
2. Globally introduced method: Add in Main.j
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.