@@ -64,7 +64,7 @@ document.loadWidget({
64
64
Within the ` <body> ` tag add the instanceId div wherever you want this widget to render.
65
65
66
66
``` html
67
- <div id =" example-widget-1" data-attr =" foobar" ></div >
67
+ <div id =" example-widget-1" data-button-text =" foobar" ></div >
68
68
```
69
69
70
70
- [ See an example] ( https://github.com/js-widgets/example-widget/blob/master/src/public/index.html#L79 ) of the widget placement implementation.
@@ -85,8 +85,8 @@ document.loadWidgets({
85
85
```
86
86
87
87
``` html
88
- <div id =" example-widget-1" data-attr =" foo" ></div >
89
- <div id =" example-widget-2" data-attr =" bar" ></div >
88
+ <div id =" example-widget-1" data-button-text =" foo" ></div >
89
+ <div id =" example-widget-2" data-button-text =" bar" ></div >
90
90
```
91
91
92
92
#### Parameters
@@ -109,7 +109,7 @@ import React, { Component } from 'react';
109
109
class Widget extends Component {
110
110
render () {
111
111
return (
112
- < div className= " App" > {this .props .obj .getAttribute (' data-attr ' )}< / div>
112
+ < div className= " App" > {this .props .obj .getAttribute (' data-button-text ' )}< / div>
113
113
);
114
114
}
115
115
}
@@ -122,15 +122,15 @@ export default Widget;
122
122
#### DIV attributes
123
123
124
124
``` html
125
- <div id =" example-widget-1" data-attr =" Hello world!" ></div >
125
+ <div id =" example-widget-1" data-button-text =" Hello world!" ></div >
126
126
```
127
127
128
128
- [ See an example] ( https://github.com/js-widgets/example-widget/blob/master/src/public/index.html#L79 ) of the widget attribute implementation.
129
129
130
130
#### Query string values
131
131
132
132
```
133
- http://localhost:3000/?data-attr =Hello%20world!
133
+ http://localhost:3000/?data-button-text =Hello%20world!
134
134
```
135
135
136
136
Note: DIV attributes are the preferred method and will always take precedence over the use of query
0 commit comments