XNSim/XNSimHtml/components/profile-center.js
2025-04-28 12:25:20 +08:00

56 lines
1.6 KiB
JavaScript

class ProfileCenter extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
}
connectedCallback() {
this.render();
}
render() {
this.shadowRoot.innerHTML = `
<style>
:host {
display: block;
height: 100%;
overflow: auto;
padding: 16px;
box-sizing: border-box;
}
.profile-container {
background-color: white;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
padding: 16px;
height: 100%;
box-sizing: border-box;
}
.profile-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
padding-bottom: 10px;
border-bottom: 1px solid #e0e0e0;
}
.profile-title {
font-size: 18px;
font-weight: bold;
color: #333;
}
</style>
<div class="profile-container">
<div class="profile-header">
<div class="profile-title">个人中心</div>
</div>
<div>个人中心组件内容(待实现)</div>
</div>
`;
}
}
customElements.define('profile-center', ProfileCenter);