@@ -49,10 +49,10 @@ function convertAttributeValue (value, name, { type } = {}) {
49
49
if ( value === 'true' || value === 'false' ) {
50
50
return value === 'true'
51
51
}
52
- if ( value === '' || value === name ) {
52
+ if ( value === '' || value === name || value != null ) {
53
53
return true
54
54
}
55
- return value != null
55
+ return value
56
56
} else if ( isNumber ( type ) ) {
57
57
const parsed = parseFloat ( value , 10 ) ;
58
58
return isNaN ( parsed ) ? value : parsed
@@ -169,13 +169,13 @@ function wrap (Vue, Component) {
169
169
170
170
class CustomElement extends HTMLElement {
171
171
constructor ( ) {
172
- super ( ) ;
173
- this . attachShadow ( { mode : 'open' } ) ;
172
+ const self = super ( ) ;
173
+ self . attachShadow ( { mode : 'open' } ) ;
174
174
175
- const wrapper = this . _wrapper = new Vue ( {
175
+ const wrapper = self . _wrapper = new Vue ( {
176
176
name : 'shadow-root' ,
177
- customElement : this ,
178
- shadowRoot : this . shadowRoot ,
177
+ customElement : self ,
178
+ shadowRoot : self . shadowRoot ,
179
179
data ( ) {
180
180
return {
181
181
props : { } ,
@@ -195,20 +195,20 @@ function wrap (Vue, Component) {
195
195
let hasChildrenChange = false ;
196
196
for ( let i = 0 ; i < mutations . length ; i ++ ) {
197
197
const m = mutations [ i ] ;
198
- if ( isInitialized && m . type === 'attributes' && m . target === this ) {
199
- syncAttribute ( this , m . attributeName ) ;
198
+ if ( isInitialized && m . type === 'attributes' && m . target === self ) {
199
+ syncAttribute ( self , m . attributeName ) ;
200
200
} else {
201
201
hasChildrenChange = true ;
202
202
}
203
203
}
204
204
if ( hasChildrenChange ) {
205
205
wrapper . slotChildren = Object . freeze ( toVNodes (
206
206
wrapper . $createElement ,
207
- this . childNodes
207
+ self . childNodes
208
208
) ) ;
209
209
}
210
210
} ) ;
211
- observer . observe ( this , {
211
+ observer . observe ( self , {
212
212
childList : true ,
213
213
subtree : true ,
214
214
characterData : true ,
0 commit comments