props-bindable
Simon Holthausen 6 months ago
parent efcc5ac6b3
commit 4d92bfb7b0

@ -1092,7 +1092,7 @@ export const validation_runes = merge(validation, a11y_validators, {
const value =
property.value.type === 'AssignmentPattern' ? property.value.left : property.value;
if (value.type !== 'Identifier' || property.key.type !== 'Identifier') {
if (value.type !== 'Identifier') {
error(property, 'invalid-props-pattern');
}
} else if (rune === '$props.bindable') {

@ -1,5 +1,6 @@
<script>
let { value, ...props } = $props.bindable();
let { ...properties } = $props();
let { value } = $props.bindable();
</script>
<button {...props} onclick={() => value++}>{value}</button>
<button {...properties} onclick={() => value++}>{value}</button>

Loading…
Cancel
Save