woodv email editor
Install
npm install woo-email-editor html-to-image --save-dev
or
yarn add woo-email-editor -D
Import
import WooEmailEditor form "woo-email-editor"
Use
const wooEmailEditor = new WooEmailEditor({
el: document.getElementById("root"),
appKey:"lsqw50avhp81g4a8iwjljhutewzztq6r",
theme:{
container:"#2C2A39",
card:"#2C2A39",
cardHeader:"#2C2A39",
border:"#fe8033",
fontColor:"rgba(255, 255, 255, 0.85)",
selectedColor:"#fe8033"
}
});
document.getElementById("save").onclick = () => {
const {html,json} = wooEmailEditor.save();
document.getElementById("html").innerHTML = html;
};
document.getElementById("update").onclick = () => {
wooEmailEditor.updateContent({});
};
document.getElementById("theme").onclick = () => {
wooEmailEditor.setTheme("dark");
};
document.getElementById("image").onclick = () => {
wooEmailEditor.getImageBase()
.then(res=>{
console.log(res);
})
.catch(e=>{
console.error(e)
})
};
#更新日志
#1.1.9
添加更深层次的主题色
const theme = {
container:"#2C2A39",
card:"#2C2A39",
cardHeader:"#2C2A39",
border:"#fe8033",
fontColor:"rgba(255, 255, 255, 0.85)",
selectedColor:"#fe8033"
}
#1.1.7
添加主题色功能(dark || light)部分输入组件完善
支持导出blob缩略图
#1.1.3
添加模板功能