I have tried adding a section script inside a view component\'s view.
@section scripts {
View component in ASP.NET Core acts like independent view with separated controller, so you can insert bellow tag above of your view component
@{ Layout = null; }
after that insert bellow tag to use related script,for example: