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?
MySQL 5.7 version: Method 1: Use the SET PASSWORD...
This article shares the specific code of js to re...
Table of contents getApp() Define variables at th...
Introduction MySQL slow query log is an important...
Docker Compose Docker Compose is a tool for defin...
MySQL 8.0.3 is about to be released. Let’s take a...
1. Four startup methods: 1.mysqld Start mysql ser...
This article uses examples to explain the princip...
Yesterday when I was implementing the function of...
Table of contents 3 ways to deploy projects with ...
Table of contents Overview Blob Blob in Action Bl...
What is a mata tag The <meta> element provi...
Preface Learn MySQL to reorganize previous non-MK...
1. The concept of css: (Cascading Style Sheet) Ad...
1. Project Structure 2.CallTomcat.java package co...