Skip to content

Commit d33285f

Browse files
committed
created a new "attributes" directive that binds input/wrapper (with support for other named sets) attributes to elements to support dynamic attributes (such as title="Tooltip Text" data-toggle="tooltip", etc)
* added directive to abstractField * implemented directive in various core fields as an example of usage * updated basic/app.vue with samples
1 parent 122ffbc commit d33285f

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

projects/basic/app.vue

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,45 @@ export default {
3838
type: "input",
3939
inputType: "text",
4040
label: "First Name",
41-
model: "first_name"
41+
model: "first_name",
42+
attributes: {
43+
input: {
44+
"data-toggle": "tooltip"
45+
},
46+
wrapper: {
47+
"data-target": "input"
48+
}
49+
}
4250
},
4351
{
4452
type: "checkbox",
4553
label: "Active",
46-
model: "status"
54+
model: "status",
55+
attributes: {
56+
input: {
57+
"data-toggle": "tooltip"
58+
}
59+
}
4760
},
4861
{
4962
type: "input",
5063
inputType: "color",
5164
label: "Color",
52-
model: "color"
65+
model: "color",
66+
attributes: {
67+
input: {
68+
"data-target": "tooltip"
69+
}
70+
}
5371
},
5472
{
5573
type: "submit",
5674
buttonText: "Change Previous Type",
75+
attributes: {
76+
input: {
77+
"data-target": "toggle"
78+
}
79+
},
5780
onSubmit: () => {
5881
// this.schema.fields[2].type = "input";
5982
if (this.schema.fields[2].inputType === "color") {

0 commit comments

Comments
 (0)