5 classic Vuex plug-ins in the Vue. JS project and vue. js classic vuex plug-ins
There are many good reasons to use Vuex to manage the status of Vue. One of them is that the Vuex plug-in can easily expand some cool functions. Developers in the Vuex community have created a large number of free plug-ins for you to use. There are many functions you can imagine and
In the vue project, after the release, the background image reports an error, the path is incorrect, and the vue background image
Solution:
In utils. js
Add publicPath :'../../',
When introducing an image or background image, use the following method:
In the above solution, after the release of the vue project, the background image reports an error. Th
Talking about how to bind variable values of vue to prevent changes, and talking about vue
1. Object. freeze (obj) Statement
Obj = {foo: "nan"} Object. freeze (obj );
After the variable is fixed with this statement, changes to this variable will be invalid and an error will be reported in the console.
2. Bind the v-once Element
After the msg data changes, the span content also changes immediately.
How to highlight Vue-route navigation menu bar, vue-navigation menu
As follows:
By default, the router navigation menu automatically adds the router-link-exact-active and router-link-active categories to the current menu.
We can use linkActiveClass to modify the router-link-active class name,
Add the configuration item linkActiveClass: 'mui-active' in the routing rule configuration, and use 'mui-active'
Vue obtains the method of the current active route, and vue obtains the current route
A route object (route information object) indicates the status information of the currently activated route, including the information parsed by the current URL, and the route records matched by the URL ).
Route object is immutable (immutable), and a new object is generated after each successful navigation.
Route object
Vue Real Combat (a): Using Vue and Ajax to implement additions and deletions:Points for attention in this project:The use of 1:ajax is not proficient2: Delete method, you can use the index, set an ID property value for each row, and then delete the item with the total Data ID property value.3: In the new item, note that JS, for example, a=b "=" is actually the equivalent of a pointer, when the value of B ch
, just as the user accesses/A.New Vuerouter ({ routes: [ '/A ', component:a, alias: '/b ' } ]})Five, navigation hooksThe navigation hooks provided by Vue-router are primarily used to intercept navigation and allow it to complete jumps or cancellations. There are several ways to execute hooks when routing navigation occurs: Global, single-route exclusive, or component-level.1 Global HooksYou can use Router.beforeeach to register a global b
Vue-quill-editor upload image will be converted to Base64 format, but this is not what we want, and then turned a lot of articles to find the desired, the following directly on the coderef= "Upload" style= "Display:none" >Reference article:https://github.com/surmon-china/vue-quill-editor/issues/102Vue+element UI +vue-quill-editor Rich Text picture upload to ride
jquery is introduced in VUE-CLI-generated projects (template webpack)First add "jquery" to the dependencies in Package.json: "^2.2.3", then NPM Install or use NPM install--registry=http:// registry.npm.taobao.org installation will be a bit fasterJoin in the webpack.base.conf.js.var webpack = require ("Webpack")In Module.exports's last additionPlugins: [New Webpack.optimize.CommonsChunkPlugin (' Common.js '),New Webpack. Provideplugin ({jquery: "jquery
Sorry, the following request of the link, I will hide the domain name, so want to try to find a friend trouble themselves for a new test, I'm sorry
Cross-domain is also configured below
1.config/index.js configuration: Troubleshooting cross-domain dev: {env:require ('./dev.env '), port:8008, Autoopenbrowser:false, Assetssubdirector Y: ' Static ', Assetspublicpath: '/', proxytable: {'/ajaxurl ': {target: ' https://www.aaaaaaa.com/', Changeo Rigin:true, Pathrewrite: {' ^/ajaxurl ': '/'}}} 2.main.
Error in render function: "Typeerror:cannot Read property ' matched ' of undefined"
webpack4.0.1, there are also the following issues (note points):
1, Vuerouter instantiation of the parameters, can be abbreviated to routes, indicating routes:routes. Note, however, that "routes:routes" indicates that the property name is routes and the value is routes. In this case (both the property name and the value are routes), you can abbreviate it. However, do not mistakenly assume that the shorthand rout
Vue. js beginner-DIY mobile terminal Input Keyboard, vue. js beginner diy keyboard
In the process of project development, we need users to input something, but we are not willing to allow users to enter anything at will. Therefore, we may choose to use a custom input method, to restrict user input, let's take a simple example to see how to set input methods on mobile Web pages. Here we still use our old fr
Vue. js forms control binding required every day, vue. js Form Control
Basic usage
You can use the v-model command to create two-way data binding on the Form Control Element. It automatically selects the correct method to update elements based on the control type. Despite the magic, v-model is just a syntactic sugar. It updates data in user input events and handles some extreme examples in particular.
Text
Vue implements two-way data binding and vue binding
Vue implements two-way data binding. The details are as follows:
How does Vue implement bidirectional data binding? The answer is front-end data hijacking. Through the Object. defineProperty () method, this method can be used to set the getter and setter functions. In
How to add mp3 audio files to vue, and how to add mp3 audio to vue
Sometimes we need to add an audio file to the vue, but when we directly place the audio file under the assets Directory, we will find that it cannot be played normally. Below are two common configuration methods:
Method 1: place the audio file in the static directory and call the file as follows:
Vue. directive () usage and instance details, vue. directive details
Official Website instance:
Https://cn.vuejs.org/v2/api/#Vue-directive
Https://cn.vuejs.org/v2/guide/custom-directive.html
The instruction definition function provides several hook functions (optional ):
Bind: it is called only once. It is called when the command is bound to an element for the fi
Use the echarts method in Vue, and use echarts for vue
The previous article introduces how to use ECharts in webpack. You can click here to view details.
1. Use NPM for installation (Global Introduction)
Run the following command:
npm install echarts--save
Introduce the echarts Module
Introduce the echarts module in main. js of the Vue project, that is, write the
Vue uses Enumeration type to implement detailed steps in HTML drop-down box, vue drop-down box
The drop-down box contains the Value in option and the option to be displayed. Generally, the Value is used in the background, rather than the option displayed on the foreground.
Step 1: Compile the enumerated types required by the drop-down box
StatusEnum. java
public enum StatusEnum { RED, YELLOW, GREEN}
Step 2:
To solve the problem that the routing page cannot be displayed normally when vue-router is built, vue-routerbuild
Use vue cli to create a webpack Project
Add vue-router and then use the route to introduce a new component. The route and link are written in this way.
const router = new VueRouter({ mode: 'history', base:
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.