You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/runtime/samples/computed-whole-state/main.html

23 lines
339 B

<pre>{JSON.stringify(props)}</pre>
<script>
export default {
data: () => ({
unwanted: 1,
wanted: 2
}),
helpers: {
// prevent this being mixed in with data
JSON
},
computed: {
props: (state) => {
var result = Object.assign({}, state);
delete result.unwanted;
return result;
}
}
};
</script>