Method 1: Call the function directlyReload the entire page. Either of the following will work:
Method 2: Use provide / inject (static refresh)Declare a reload refresh function in the higher-order function <template> <div id="app" v-if="show"></div> </template> <script> export default { //Control display/hide, implement refresh data () { return { show: true } }, // Pass the refresh method to the low-level component provide () { return { reload: this.reload } }, methods: { // High-level component defines refresh method reload () { this.bol = false this.$nextTick(() => { this.bol = true }) } } } </script> Using refresh functions in low-level components <template> <div></div> </template> <script> export default { inject: ['reload'], methods: { // Low-level component, refresh fun () { this.reload() } } } </script> Advantages Comparison
The above is the details of the method of applying provide and inject to refresh the Vue page. For more information about Vue page refresh, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
<<: Detailed explanation of root directory settings in nginx.conf
>>: Which one should I choose between MySQL unique index and normal index?
When it comes to styling our web pages, we have t...
Today we will look at why master-slave delay occu...
Please open the test page in a mainstream browser...
Usage Environment In cmd mode, enter mysql --vers...
I have encountered the Nginx 502 Bad Gateway erro...
Table of contents 1. Array flattening (also known...
This tutorial shares the installation of mysql in...
content Use scaffolding to quickly build a node p...
Logpoint-based replication 1. Create a dedicated ...
Preface Here are the steps to install and configu...
Table of contents 1. Install the proxy module 2. ...
Why is it that when the input tag type is file an...
Preface Sometimes you need to keep the height of ...
1. Why create an index? (Advantages) This is beca...
Table of contents 1. The simplest example 2. Cust...