Where should I include a script for a view component?

前端 未结 5 1907
故里飘歌
故里飘歌 2021-02-20 04:26

I have tried adding a section script inside a view component\'s view.

@section scripts {
    

        
5条回答
  •  Happy的楠姐
    2021-02-20 04:28

    From what I have seen, a "@section Scripts {}" in a ViewComponent is ignored and does not render in the relevant @RenderSection() of the ViewComponents _*layout.cshtml

    Why that is I do not know.

提交回复
热议问题