Skip to content

Commit 73aedeb

Browse files
committed
update some tests
1 parent 7b50c9c commit 73aedeb

File tree

134 files changed

+653
-1191
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+653
-1191
lines changed
Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
1+
<script>
2+
export let hidden = true;
3+
4+
export function toggle() {
5+
hidden = !this.get().hidden;
6+
}
7+
</script>
8+
19
{#if !hidden}
210
<slot></slot>
3-
{/if}
4-
5-
<script>
6-
export default {
7-
data () {
8-
return {
9-
hidden: true
10-
};
11-
},
12-
methods: {
13-
toggle () {
14-
this.set({
15-
hidden: !this.get().hidden
16-
});
17-
}
18-
}
19-
};
20-
</script>
11+
{/if}
Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
<Two bind:foo/>
2-
31
<script>
2+
import { onmount } from 'svelte';
43
import Two from './Two.html';
54

6-
export default {
7-
components: {
8-
Two
9-
},
5+
export let snapshot;
6+
export let foo;
7+
8+
onmount(() => {
9+
snapshot = foo;
10+
});
11+
</script>
1012

11-
oncreate() {
12-
this.snapshot = this.get().foo;
13-
}
14-
};
15-
</script>
13+
<Two bind:foo/>
Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
<script>
2-
export default {
3-
data() {
4-
return {
5-
bar: 1
6-
};
7-
},
2+
export let bar = 1;
83

9-
computed: {
10-
foo({ bar }) {
11-
return bar * 2;
12-
}
13-
}
14-
};
4+
function foo() {
5+
return bar * 2;
6+
}
157
</script>
Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
1-
<p>bar in Foo: {bar}</p>
2-
<p>baz in Foo: {baz}</p>
3-
41
<script>
5-
export default {
6-
data() {
7-
return {
8-
bar: 1,
9-
baz: 2
10-
};
11-
},
2+
export let bar = 1;
3+
export let baz = 2;
124

13-
methods: {
14-
double() {
15-
const { bar, baz } = this.get();
16-
this.set({ bar: bar * 2, baz: baz * 2 });
17-
}
18-
}
19-
};
20-
</script>
5+
export function double() {
6+
bar = bar * 2;
7+
baz = baz * 2;
8+
}
9+
</script>
10+
11+
<p>bar in Foo: {bar}</p>
12+
<p>baz in Foo: {baz}</p>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<div class:one="true"></div>
1+
<div class:one="true"></div>
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
<div class:active="isActive(user)"></div>
2-
31
<script>
4-
export default {
5-
helpers: {
6-
isActive(user) {
7-
return user.active;
8-
}
9-
}
2+
export let user;
3+
4+
function isActive(user) {
5+
return user.active;
106
}
117
</script>
8+
9+
<div class:active="isActive(user)"></div>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{#each things as thing}
22
<div class:selected="selected === thing"></div>
3-
{/each}
3+
{/each}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<div class="{ myClass }" class:is-active class:isSelected class:not-used></div>
1+
<div class="{ myClass }" class:is-active class:isSelected class:not-used></div>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<div class:is-active class:isSelected class:not-used></div>
1+
<div class:is-active class:isSelected class:not-used></div>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<div class="one" class:two="true" class:three="true"></div>
1+
<div class="one" class:two="true" class:three="true"></div>

0 commit comments

Comments
 (0)