Include a javascript for composite component only once in a page despite of composite components themselves used multiple times

前端 未结 1 1786
别那么骄傲
别那么骄傲 2021-01-18 05:05

How do I include a JavaScript code only once for multiple usages of a composite component on a page?

Initially I had put I put the JS code inside the cc:impl

1条回答
  •  借酒劲吻你
    2021-01-18 05:25

    Include the static part of that JS code as a standalone JS file by with target="head". It'll be rendered into just once.

    
        
        ...
    
    

    0 讨论(0)
提交回复
热议问题