|
@@ -17,12 +17,15 @@ export default function renderAttrs (node: VNodeWithData): string {
|
|
|
let attrs = node.data.attrs
|
|
let attrs = node.data.attrs
|
|
|
let res = ''
|
|
let res = ''
|
|
|
|
|
|
|
|
- let parent = node.parent
|
|
|
|
|
- while (isDef(parent)) {
|
|
|
|
|
- if (isDef(parent.data) && isDef(parent.data.attrs)) {
|
|
|
|
|
- attrs = Object.assign({}, attrs, parent.data.attrs)
|
|
|
|
|
|
|
+ const opts = node.parent && node.parent.componentOptions
|
|
|
|
|
+ if (isUndef(opts) || opts.Ctor.options.inheritAttrs !== false) {
|
|
|
|
|
+ let parent = node.parent
|
|
|
|
|
+ while (isDef(parent)) {
|
|
|
|
|
+ if (isDef(parent.data) && isDef(parent.data.attrs)) {
|
|
|
|
|
+ attrs = Object.assign({}, attrs, parent.data.attrs)
|
|
|
|
|
+ }
|
|
|
|
|
+ parent = parent.parent
|
|
|
}
|
|
}
|
|
|
- parent = parent.parent
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (isUndef(attrs)) {
|
|
if (isUndef(attrs)) {
|