[英]How to hide grid action button from "sw-entity-listing" listing in shopware 6?
[英]Shopware 6 sw-number-field: how to set id?
如何在自定义插件中设置sw-number-field.id
?
默认情况下, sw-number-field.id
的配置是设计违规。
这可以在产品详细信息页面上的价格字段中观察到:
// sw-number-field.html.twig
<template #sw-field-input="{ identification, error, disabled, size, setFocusClass, removeFocusClass }">
<!-- eslint-disable-next-line vuejs-accessibility/form-control-has-label -->
<input
:id="identification"
identification
来自哪里,或者应该在哪里设置?
您可以使用name
属性,它也将替换自动生成的id
。
<sw-number-field name="foobar" />
<!-- becomes -->
<input id="foobar" name="foobar" type="text" placeholder="" autocomplete="off">
默认设置在src/app/component/form/field-base/sw-base-field/index.js
data() {
return {
id: utils.createId(),
};
},
computed: {
identification() {
if (this.name) {
return this.name;
}
return `sw-field--${this.id}`;
},
//...
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.