更新登录组件,添加密码登录方法,修改版本号至0.1.0,并新增示例网页
This commit is contained in:
@@ -74,7 +74,7 @@
|
||||
<div class="demo-container">
|
||||
<div class="login-section">
|
||||
<h2>登录组件</h2>
|
||||
<kv-login>
|
||||
<kv-login method="password">
|
||||
<div id="weixinLogin"></div>
|
||||
</kv-login>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@kevisual/kv-login",
|
||||
"version": "0.0.8",
|
||||
"version": "0.1.0",
|
||||
"description": "",
|
||||
"main": "src/main.ts",
|
||||
"scripts": {
|
||||
|
||||
21
readme.md
21
readme.md
@@ -4,9 +4,26 @@
|
||||
|
||||
黑白
|
||||
|
||||
|
||||
```html
|
||||
<kv-login>
|
||||
<div id="weixinLogin"></div>
|
||||
</kv-login>
|
||||
```
|
||||
```
|
||||
|
||||
## 网页
|
||||
|
||||
```html
|
||||
<script type="importmap">
|
||||
{
|
||||
"imports": {
|
||||
"@kevisual/kv-login": "https://esm.kevisual.cn/@kevisual/kv-login"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
import '@kevisual/kv-login';
|
||||
</script>
|
||||
<kv-login method="password">
|
||||
<div id="weixinLogin"></div>
|
||||
</kv-login>
|
||||
```
|
||||
|
||||
@@ -85,6 +85,7 @@ class KvLogin extends HTMLElement {
|
||||
if (loginMethods.length > 0) {
|
||||
this.loginMethods = getLoginMethod(loginMethods)
|
||||
this.selectedMethod = loginMethods[0]
|
||||
this.setLoginMethods(this.loginMethods);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
93
web.html
Normal file
93
web.html
Normal file
@@ -0,0 +1,93 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>KvMessage Demo</title>
|
||||
<script type="importmap">
|
||||
{
|
||||
"imports": {
|
||||
"@kevisual/kv-login": "https://esm.kevisual.cn/@kevisual/kv-login"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
import '@kevisual/kv-login';
|
||||
</script>
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 20px;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||
}
|
||||
|
||||
.demo-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
padding: 40px 20px;
|
||||
}
|
||||
|
||||
.button-group {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.demo-button {
|
||||
padding: 10px 20px;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.demo-button.success {
|
||||
background: #52c41a;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.demo-button.success:hover {
|
||||
background: #389e0d;
|
||||
}
|
||||
|
||||
.demo-button.error {
|
||||
background: #ff4d4f;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.demo-button.error:hover {
|
||||
background: #cf1322;
|
||||
}
|
||||
|
||||
.demo-button.loading {
|
||||
background: #1890ff;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.demo-button.loading:hover {
|
||||
background: #096dd9;
|
||||
}
|
||||
|
||||
.login-section {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="demo-container">
|
||||
<div class="login-section">
|
||||
<h2>登录组件</h2>
|
||||
<kv-login method="password">
|
||||
<div id="weixinLogin"></div>
|
||||
</kv-login>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user