You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+43Lines changed: 43 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1079,3 +1079,46 @@ Below is a table of the places where such line breaks can be used:
1079
1079
## PDF generation
1080
1080
1081
1081
This package requires jspdf as a peer dependency. Please install it in your project if you intend on using the PDF printing feature.
1082
+
1083
+
## `useObjectBindings`
1084
+
1085
+
A composable that **flattens** a reactive object into a set of computed refs—one for each “leaf” property—so you can easily bind to deeply nested values by their string paths.
1086
+
1087
+
### Why use it?
1088
+
1089
+
-**Automatic reactivity**: Every nested property becomes a `ComputedRef`, with automatic getters/setters that keep your source object in sync.
1090
+
-**Flat API surface**: Access or update any nested field by its dot‑delimited path, without writing deep destructuring or `ref` plumbing.
1091
+
-**Dynamic path support**: New paths added at runtime are discovered automatically (and proxied), so you never lose reactivity when mutating the structure.
1092
+
1093
+
```js
1094
+
import { useObjectBindings } from"vue-data-ui";
1095
+
importtype { Ref, ComputedRef } from"vue";
1096
+
1097
+
constconfig=ref({
1098
+
customPalette: ["#CCCCCC", "#1A1A1A"],
1099
+
style: {
1100
+
chart: {
1101
+
backgroundColor:"#FFFFFF",
1102
+
color:"#1A1A1A",
1103
+
},
1104
+
},
1105
+
});
1106
+
1107
+
constbindings=useObjectBindings(config);
1108
+
// Now `bindings` has computed refs for each leaf path:
0 commit comments