Pit record DAY1:
1. Project Version:
When using vUE, some scenarios may require dynamic modification of some data. This problem is encountered today when using VUe-awesome-swiper. In the above scenarios, the following options for Swiper5 are used:
Several common data can be dynamically modified, for example, click the button to obtain the content of the input box, modify the option of swiper, but the speed attribute cannot be modified, directly modify the option attribute, will jump to the first picture, and then jammed. The observerUpdate hook function can be found in the on property. In the function body, this refers to swiper itself. It is known that speed can be changed in this.params.speed and the situation will not be stuck, but because this is pointing to the problem in function, localStorage is used here for data transfer. Not much force force above!
Use elementui, whatever you want, and click on the button:
Now the local data is stored, then the observerUpdate:
ObserverUpdate can only listen for DOM changes or form data changes, but not for button press events. So an elementUI $confirm is used to trigger the obServerUpdate. Tips: If you want this to point to vue in the event hook of on, you can use the arrow function, or define a _self=this outside.