TASK:#110915 修改传值更新和部分代码细节

This commit is contained in:
lvxiangcong 2022-10-13 16:16:32 +08:00
parent 35f7edaf4f
commit 853a2b72fb
3 changed files with 9 additions and 9 deletions

View File

@ -69,7 +69,7 @@ export const sharedStyles: CSSResult = css`
width: var(--autoPoint);
height: var(--autoPoint);
position: absolute;
left: 50%;
right: 50%;
top: 0;
background: linear-gradient(
90deg,
@ -77,7 +77,7 @@ export const sharedStyles: CSSResult = css`
rgba(245, 245, 245, 0.01) 100%
);
border-radius: 50%;
transform: translate(50%, 0);
transform: translate(-50%, 0);
}
.star-clock-hour-hand {
position: absolute;

View File

@ -28,7 +28,8 @@ export class StarClock extends LitElement {
if (val.constructor.toString().includes('String')) {
val.toString().length <= 13 ? (val = Number(val)) : ''
}
val && this.dateUpdated(val)
// val && this.dateUpdated(val)
val && setInterval(()=>{this.dateUpdated(new Date())}, 1000)
}
@query('.star-clock')
@ -41,7 +42,7 @@ export class StarClock extends LitElement {
(item) => html`
<span
class="star-clock-rotate"
style="transform: rotate(${(360 / 12) * item}deg) "
style="transform: rotate(${(360 / 12) * item}deg)"
>
<span class="star-clock-point-transparent"></span>
</span>
@ -68,8 +69,7 @@ export class StarClock extends LitElement {
>
<span
class="star-clock-point"
style="transform: rotate(${-(360 / 12) *
item}deg) translate(-50%, 0)"
style="transform: rotate(${-(360 / 12) * item}deg)"
></span>
</span>
`
@ -124,7 +124,7 @@ export class StarClock extends LitElement {
// 秒针
if (secondTime === 0) {
this.rotateSecond = 360
setTimeout(() => {
window.setTimeout(() => {
this.rotateSecond = 0
}, 930)
} else {

View File

@ -47,12 +47,12 @@ export class PanelClock extends LitElement {
}
static styles = css``
protected firstUpdated() {
setInterval(()=>{
// setInterval(()=>{
this.clockTest1.date = new Date()
this.clockTest2.date = new Date()
this.clockTest3.date = new Date()
this.clockTest4.date = new Date()
}, 1000)
// }, 1000)
}
}
declare global {