Reloading an Element After Data Is Loaded in Polymer

前端 未结 2 792
孤城傲影
孤城傲影 2021-01-20 08:09

I am building an app with Polymer. In my app, a user logs into the app. When they login, I am trying to show their orders. They can then choose an order and view the order d

2条回答
  •  日久生厌
    2021-01-20 08:47

    You can use custom event fired from the host for reloading your customers-orders when login is successfully, For viewing the customer order you need to grab the orders selected by the customer. Add another Object for storing selecting orders let's says selectedOrders and using array-selector you can ensures path linkage when selecting specific items and store orders in selectedOrders. I have scaffold something here , though I did not test it can gives you something that might help you. Especially

    1. using array-selector for storing selecting elements
    2. fire an event from the host using custom event function : fire

    customer-orders elements

    
        
    
         
    

    the customer-order element should have a property data that fetch selected orders data from the selectedOrder in customers-orders.

    customer-order

    
        
    
         
    

    Now your app will look like

提交回复
热议问题