更新登录组件,支持多种登录方式,修改版本号至0.1.1,并更新示例代码

This commit is contained in:
2025-12-17 15:08:31 +08:00
parent 65ee31e8ca
commit 7db3f1f6dc
6 changed files with 50 additions and 9 deletions

View File

@@ -320,10 +320,18 @@ class KvLogin extends HTMLElement {
return this.renderPasswordForm()
}
}
createWeixinEl(){
const id = 'weixinLogin';
let el = this.querySelector('#' + id);
if (el) return el;
const weixinEl = document.createElement('div');
weixinEl.id = 'weixinLogin';
this.appendChild(weixinEl);
return weixinEl;
}
render() {
if (!this.shadowRoot) return
this.createWeixinEl();
const renderIcon = (icon: any) => {
// 如果是emoji字符直接返回
if (typeof icon === 'string' && !icons[icon]) {