feat: cria codigo para inserir um placeholder no cep

This commit is contained in:
Emmanuel Vitor Pereira de Jesus 2023-02-06 20:41:35 -03:00
parent 936b06110e
commit 59896a1f9d
4 changed files with 23 additions and 1 deletions

3
react/Placeholder.ts Normal file
View File

@ -0,0 +1,3 @@
import Placeholder from "./components/Placeholder/Placeholder";
export default Placeholder;

View File

@ -0,0 +1,13 @@
const Placeholder = () => {
if (typeof document !== "undefined") {
const m3Input = document.querySelector(".vtex-address-form-4-x-input");
m3Input?.setAttribute("placeholder", "Digite seu CEP");
}
return null;
}
export default Placeholder;

View File

@ -194,7 +194,7 @@
"props": {
"blockClass": "m3-shipping-simulator"
},
"children": ["rich-text", "shipping-simulator"]
"children": ["rich-text", "shipping-simulator", "m3-placeholder"]
},
"rich-text": {
"props": {

View File

@ -5,5 +5,11 @@
"html": {
"component": "html",
"composition": "children"
},
"m3-placeholder": {
"component": "Placeholder"
},
"m3-pix": {
"component": "Pix"
}
}