current position:Home>Patch update details for vue3

Patch update details for vue3

2022-06-24 09:21:38yibucuo

1. Execute the following code

Case a

<script src="../../dist/vue.global.js"></script>
<div id="app">
  <h1>vue3  Update process </h1>
  <p>{
    {
    count}}</p>
  <comp></comp>
</div>
<script>
  var app = createApp({
    
    data() {
    
      return {
    
        count: 1
      }
    },
    mounted() {
    
      this.count++
    },
    components: {
    
      comp: {
    
        template: '<div>comp-comp</div>'
      }
    }
  })
  app.mount('#app')
</script>

Case 2

<script src="../../dist/vue.global.js"></script>
<div id="app">
  <h1>vue3  Update process </h1>
  <p>{
    {
    count}}</p>
  <comp></comp>
</div>
<script>
  var app = createApp({
    
    data() {
    
      return {
    
        count: 1
      } 
    },
    mounted() {
    
      this.count++
    },
    components: {
    
      comp: {
    
        template: '<div>comp-comp</div>'
      }
    }
  })
  app.mount('#app')
</script>

2. flow chart

ProcessOn

copyright notice
author[yibucuo],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/175/202206240801439281.html

Random recommended