replace _componentTag to componentName

pull/732/head
baiyaaaaa 2016-10-30 19:36:03 +08:00 committed by cinwell.li
parent 2e77e5a50b
commit 135c8ed45b
7 changed files with 17 additions and 15 deletions

View File

@ -4,6 +4,8 @@
export default {
name: 'ElCheckboxGroup',
componentName: 'ElCheckboxGroup',
mixins: [Emitter],
props: {

View File

@ -85,7 +85,7 @@
data() {
return {
focus: false,
wrapInGroup: this.$parent.$options._componentTag === 'el-checkbox-group'
wrapInGroup: this.$parent.$options.componentName === 'ElCheckboxGroup'
};
},

View File

@ -1,8 +1,8 @@
<script>
module.exports = {
name: 'el-menu-item-group',
name: 'ElMenuItemGroup',
componentName: 'menu-item-group',
componentName: 'ElMenuItemGroup',
props: {
title: {
@ -19,14 +19,14 @@
initPadding() {
var parent = this.$parent;
var level = 0;
var componentTag = parent.$options._componentTag;
var component = parent.$options.componentName;
while (componentTag !== 'el-menu') {
if (componentTag === 'el-submenu') {
while (component !== 'ElMenu') {
if (component === 'ElSubmenu') {
level++;
}
parent = parent.$parent;
componentTag = parent.$options._componentTag;
component = parent.$options.componentName;
}
this.paddingLeft += level * 10;
}

View File

@ -1,9 +1,9 @@
<script>
import Menu from './menu-mixin';
module.exports = {
name: 'el-menu-item',
name: 'ElMenuItem',
componentName: 'menu-item',
componentName: 'ElMenuItem',
mixins: [Menu],

View File

@ -3,7 +3,7 @@ module.exports = {
indexPath() {
var path = [this.index];
var parent = this.$parent;
while (parent.$options._componentTag !== 'el-menu') {
while (parent.$options.componentName !== 'ElMenu') {
if (parent.index) {
path.unshift(parent.index);
}
@ -13,7 +13,7 @@ module.exports = {
},
rootMenu() {
var parent = this.$parent;
while (parent.$options._componentTag !== 'el-menu') {
while (parent.$options.componentName !== 'ElMenu') {
parent = parent.$parent;
}
return parent;

View File

@ -14,7 +14,7 @@
export default {
name: 'ElMenu',
componentName: 'menu',
componentName: 'ElMenu',
mixins: [emitter],
@ -91,7 +91,7 @@
this.$emit('select', index, indexPath, instance);
if (this.mode === 'horizontal') {
this.broadcast('submenu', 'item-select', [index, indexPath]);
this.broadcast('ElSubmenu', 'item-select', [index, indexPath]);
this.openedMenus = [];
} else {
this.openActiveItemMenus();

View File

@ -25,9 +25,9 @@
import menuMixin from './menu-mixin';
module.exports = {
name: 'el-submenu',
name: 'ElSubmenu',
componentName: 'submenu',
componentName: 'ElSubmenu',
mixins: [menuMixin],