问题标签 [view-components]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
ruby-on-rails - How can I use a Custom Channel of Action Cable with Stimulus Reflex and View Component?
So, I'm working on a project that should have a chat component same as the linkedin chat, where the user will have all their contacts and messages.
But, I've tried of all ways to work with stimulus_reflex
and view_component
to create this chat_box
, but until now I had none progress.
So right now I'm trying to create a chat with pure action_cable, but my doubt is: Can I use this action_cable channel ('ChatRoom')
with Stimulus Reflex
? Because when we see the rails console shows something like this: Broadcasting to StimulusReflex::Channel:1
, and I want to Broadcast to the ChatRoom Channel
.
Someone was tried the same?
asp.net-core - 如何在 ViewComponent 中重用联系表单?
我想在我的项目的多个页面上使用相同的联系表。
我在一个名为FormInViewComponent
如下的示例项目上进行了尝试:
Controllers
>TestController.cs
Views
> Test
> (我在这个页面上Index.cshtml
调用了)ViewComponent
Models
>FormModel.cs
ViewComponents
>SampleFormViewComponent.cs
Views
> Shared
> Components
> SampleForm
>Default.cshtml
asp.net-core-mvc - 在 .NET Core MVC 中将表单数据从视图组件传递到控制器
我有一个组件视图,我尝试从其中的表单更新数据,我调用控制器但在控制器中我收到 null :
在我看来
我已经减少了大部分视图代码,但它包含了模型需要的所有数据。这是我的控制器:
它应该可以工作我不知道为什么它一直向我的控制器发送 null 。
laravel - InvalidArgumentException 无法找到组件 [queryUrl-sort] 的类或视图 [Forrestedw\QueryUrlBuilder\Sort]
我收到以下错误:
当我调用包中的组件时,我是这样制作的:
这是包的服务提供者的引导方法:
这是包中的文件结构:
这Sort
看起来像:
任何人都可以帮忙吗?我真的被这个卡住了!
javascript - 视图组件中的日期时间选择器
我有一个适用于 javascript 的日期选择器,我希望它在视图组件中。
我的问题:当我调用视图组件时它工作正常,但是当使用 Ajax 日期选择器调用视图组件时它不起作用
c# - 如何检查 ViewComponent 视图是否存在?
有没有办法在尝试渲染之前检查 ViewComponent 的 View 是否真的存在?
我知道有FindView和GetView方法可以从控制器中搜索视图,我正在为 ViewComponents 寻找类似的东西。
在ViewComponent内部,有一个ViewEngine,但是当我尝试使用它时...
... 结果的 SearchedLocations 不是在寻找 ViewComponents:
注意:问这个问题是因为 try-catch 块没有捕捉到缺少视图时发生的异常,例如...
... 由于缺少视图文件,会导致未处理的异常。
c# - 在 razor 视图中找不到“Invoke”或“InvokeAsync”方法错误
在我的视图中使用视图组件时,我收到了这个没有意义的错误。当我打开一个使用视图组件的视图(为所述视图组件调用标签助手)时,我看到了一个错误,我无法在 Visual Studio 的错误列表部分中解决这个问题。
仅当打开 cshtml 文件时,错误才会显示在错误列表中。如果我关闭 cshtml 文件,错误就会消失。每个打开的 cshtml 文件都会重复该错误。
该错误永远不会阻止应用程序构建,它会按预期呈现视图组件..
这个错误只是在视觉上很烦人,可能会产生误导......有没有办法摆脱这个?我是否在做一些不正确的事情来显示此错误?这是 Visual Studio 错误吗?
编辑:我的应用程序有许多视图组件。我经常从视图组件视图中调用其他视图组件。这似乎是导致错误的原因,但我不明白为什么......即使许多视图组件都这样做..错误仅针对一个视图组件显示,但对于每个打开的cshtml文件都重复...如果我注释掉从视图组件视图中调用视图组件标记帮助程序的行,则错误现在转移到一些其他相同的视图组件仍然为每个视图重复.. 非常混乱!
任何帮助表示赞赏谢谢..
错误:
ViewComponent 实现类 -->
SomeViewComponent.cshtml(调用嵌套视图组件)-->
一些使用 SomeViewComponent 的视图 -->