Skip to content

Commit ee32d8e

Browse files
committed
feat: 允许通过.store为auto-form绑定表单
1 parent 4e02e01 commit ee32d8e

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

packages/form/examples/group-tabs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ class AutoFormExampleTabs extends LitElement {
6060
return html`
6161
<div style="border: var(--auto-border);padding:1rem;margin-bottom:1rem;">
6262
<auto-form .store=${this.refStore}> </auto-form>
63-
<button style="margin:1rem;padding: 1rem" @click=${() => {
63+
<button style="margin-top:1rem;padding: 0.5rem;cursor:pointer" @click=${() => {
6464
this.refStore = this.count % 2 === 0 ? store2 : store1;
65-
this.count = this.count++;
65+
this.count = this.count + 1;
6666
}} >切换Store</button>
6767
</div>
6868
<auto-form group="car" icon="car"> </auto-form>

packages/form/index.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@
1010
rel="stylesheet"
1111
href="https://cdn.jsdelivr.net/npm/@shoelace-style/[email protected]/cdn/themes/light.css"
1212
/>
13-
<!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@shoelace-style/[email protected]/cdn/themes/dark.css" /> -->
1413

1514
<link rel="stylesheet" href="./node_modules/themepro/dist/index.css" />
1615
<link rel="stylesheet" href="./node_modules/themepro/dist/dark.css" />
1716
<link rel="stylesheet" href="./node_modules/themepro/dist/blue.css" />
1817
<link rel="stylesheet" href="./node_modules/themepro/dist/red.css" />
19-
<!-- <link rel="stylesheet" href="./src/themes/light.css" /> -->
2018

2119
<script type="module" src="/src/index.ts"></script>
2220
</head>

packages/form/src/form/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export class AutoForm extends LitElement {
182182
if (changedProperties.has("store")) {
183183
this.bind(this.store!);
184184
}
185-
return changedProperties.has("store");
185+
return true;
186186
}
187187
attributeChangedCallback(name: string, _old: string | null, value: string | null): void {
188188
super.attributeChangedCallback(name, _old, value);

0 commit comments

Comments
 (0)