vue-generators / vue-form-generator

:clipboard: A schema-based form generator component for Vue.js
MIT License
2.99k stars 531 forks source link

attributes don't seem to work with v3.beta.7 #576

Open vesper8 opened 5 years ago

vesper8 commented 5 years ago

I see that you are using attributes in a few places in the v3 examples such as in the basic demo here: https://github.com/vue-generators/vue-form-generator-examples/blob/master/projects/basic/app.vue

I cloned and ran these however and couldn't see any tooltips and in the debugger I couldn't see any of the attributes actually added

I also have been trying to add attributes in my own code. I'm using v3.beta.7 (which I realize is a WIP and not ready for production) and I can't get attributes to do anything. They are not rejected when used at the field level, but they just don't do anything. I have tried following the instructions found here https://github.com/vue-generators/vue-form-generator/issues/492 and have tried both adding the attributes directly in the field like so:

            [
                'model' => 'something',
                'label' => 'Something',
                'type' => 'input',
                'fieldOptions' => [
                    'inputType' => 'text',
                ],
                'attributes' => [
                    'title' => 'title-text',
                    'data-toggle' => 'tooltip',
                ],
            ],

as well as the other suggested way which allows you to target the wrapper or input separately:

            [
                'model' => 'something',
                'label' => 'Something',
                'type' => 'input',
                'fieldOptions' => [
                    'inputType' => 'text',
                ],
                'attributes' => [
                    'input' => [
                        'title' => 'title-text',
                        'data-toggle' => 'tooltip',
                    ],
                    'wrapper' => [
                        'title' => 'title-text',
                        'data-toggle' => 'tooltip',
                    ],
                ],
            ],

But neither way seems to produce any effect

zoul0813 commented 5 years ago

attributes may not have been merged into the v3 branch yet - those are a fairly recent v2 addition.

muschottkey commented 4 years ago

This is due to bug fixed in https://github.com/vue-generators/vue-form-generator/pull/644