mirror of https://github.com/sveltejs/svelte
parent
6444e8da29
commit
bdba7531df
@ -0,0 +1,12 @@
|
|||||||
|
export default {
|
||||||
|
data: {
|
||||||
|
x: 10
|
||||||
|
},
|
||||||
|
|
||||||
|
html: 'potato',
|
||||||
|
|
||||||
|
test ( assert, component, target ) {
|
||||||
|
component.set({ x: 3 });
|
||||||
|
assert.htmlEqual( target.innerHTML, 'potato' );
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,15 @@
|
|||||||
|
{{Math.min(x, 5)}}
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
Math: {
|
||||||
|
min ( a, b ) {
|
||||||
|
return 'potato';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -0,0 +1,12 @@
|
|||||||
|
export default {
|
||||||
|
data: {
|
||||||
|
x: 10
|
||||||
|
},
|
||||||
|
|
||||||
|
html: 'potato',
|
||||||
|
|
||||||
|
test ( assert, component, target ) {
|
||||||
|
component.set({ x: 3 });
|
||||||
|
assert.htmlEqual( target.innerHTML, 'potato' );
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,13 @@
|
|||||||
|
{{Math.min(x, 5)}}
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
helpers: {
|
||||||
|
Math: {
|
||||||
|
min ( a, b ) {
|
||||||
|
return 'potato';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in new issue