[英]How to extend/modify an existing Laravel Nova field?
I'd like to modify the Code
component of Laravel Nova.我想修改 Laravel Nova 的
Code
组件。 For example in the file: vendor/laravel/nova/resources/js/components/Detail/CodeField.vue
例如在文件中:
vendor/laravel/nova/resources/js/components/Detail/CodeField.vue
I'd like to modify the config
object near the bottom, specifically, I'd like to change the following line to false
:我想修改靠近底部的
config
object ,具体来说,我想将以下行更改为false
:
indentWithTabs: true,
How would I go about modifying this value and having it persist with the ephemeral nature of the vendor
folder?我将如何 go 修改此值并使其与
vendor
文件夹的短暂性质保持一致?
I do not think that you can "modify" an existing Field, but you can create the same Field containing the same logic, and adding your customizations as described here .我不认为您可以“修改”现有字段,但您可以创建包含相同逻辑的相同字段,并按照此处所述添加您的自定义项。
You can also check if you're able to extend a custom field and override it - as described here .您还可以检查是否能够扩展自定义字段并覆盖它 - 如此处所述。
You could also try to apply this change in the root repository and check if the maintainers of nova will apply this change.您也可以尝试在根存储库中应用此更改,并检查 nova 的维护者是否会应用此更改。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.