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
Add, delete, modify, and query vue, and add, delete, and modify vue
We save the user informationlistIn the array, add, delete, modify, and query on the array:
List: [{username: 'aaaaa', email: '2017 @ qq.com ', sex: 'male', province: 'beijing', holobby: ['basketball ', 'reading', 'programmer']}, {username: 'bbbbbb', email: 'bbbbbbb @ 163.com ', sex: 'female', province: 'hebei province ', holobby: [play the
Vue. js achieves price formatting and vue. js prices formatting
Here we will share a common price formatting method which is very practical in e-commerce price processing. We can see an effect.
Here, a filter is used for the price data, which is used to retain the decimal places of the price.
HTML
JS
Filters: {// data filter format: function (value) {var html, _ val; value = Number (value ). toFixe
Vue dynamically achieves scoring results and vue dynamic scoring
The examples in this article share with you the specific code for Vue to dynamically achieve the scoring effect for your reference. The specific content is as follows:
1. There are three types of images:
On: half: off
Change code as needed
The above is all the content of this article. I hope it w
Vue dynamically generates dom and automatically binds events. vue dynamically binds dom
When using jquery, you will find that the dom dynamically generated after page rendering cannot be obtained from the code before it is generated and must be retrieved again. however, based on the data binding feature, vue enables it to directly bind data when it is generated.
The use of vue double curly braces is accompanied by exercise questions and vue exercises
The examples in this article share the specific code of the vue double curly braces for your reference. The specific content is as follows:
Code:
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.
Implementation Method of vue currency filter, vue currency Filter
Custom events can also be used to create custom form input components and use v-model for bidirectional data binding.
To make the v-model of a component take effect, it must:
Accept a value Attribute
Triggers input events when new values exist.
The Code is as follows:
HTML:
Javascript:
Vue.component('currency-input', { template: `\
As
Vue. js or js to achieve the sorting of Chinese A-Z, vue. jsjs Chinese a-z
According to the A-Z method, you can write in the vue's methods:
Methods: {pySort: function (arr, empty) {var $ this = this; if (! String. prototype. localeCompare) return null; var letters = "ABCDEFGHJKLMNOPQRSTWXYZ ". split (''); var zh =" ". split (''); var arrList = []; for (var m = 0; m
Convert the json object obtained from ph
Vue. js gets the value instance in select, vue. jsvalue
As follows:
The above example of getting the value in the select using vue. js is all the content that I have shared with you. I hope to give you a reference and support for the customer's house.
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.