title: How to get out the data from created application with method in VUE 3
body: <p>When starting page, this happens:</p>
  <ol>
  <li>console.log(products.showData()) shows undefined</li>
  <li>Uncaught TypeError: products.showData is not a function</li>
  <li>Uncaught (in promise) TypeError: products.productList is undefined</li>
  </ol>
  <p>All what I wanted is just return 1 with showData method.
  Can anybody please tell me what's wrong in this code?</p>
  <pre><code>&lt;script&gt;
  var products = Vue.createApp ({
              el:&quot;#products&quot;,
              data: function() {
                  return {
                      productList: [],
                      product: {
                          sku: 0,
                          name: '',
                          price: 0,
                          attr: {
                              size: 0,
                              weight: 0,
                              dimensions: {
                                  h: 0,
                                  w: 0,
                                  l: 0
                              }
                          }
                      }
                  }
              },
  
              components: ['sku'],
              methods:{
                  addProduct: function(){
                      this.productList.push(this.product)
                      console.log(this.productList[0]['sku'])
                  },
                  showData: function(){
                      return '1'
                  }
              }
          })
          
          products.mount(&quot;#products&quot;)
          
          products.component('product', {
              template: `
                  &lt;span&gt;
                  {{ this.sku }}&lt;br&gt;
                  {{ this.name }}&lt;br&gt;
                  {{ this.price }}&lt;br&gt;
                  {{ this.size }}
                  &lt;/span&gt;
              ` ,
              data: function(){
                  return {
                      'sku': products.productList[0]['sku'],
                      'name': 'name',
                      'price': 100,
                      'size': 10
                  }
              }
          })
          
      console.log(products.showData())
  </code></pre>