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 { export default {
name: 'ElCheckboxGroup', name: 'ElCheckboxGroup',
componentName: 'ElCheckboxGroup',
mixins: [Emitter], mixins: [Emitter],
props: { props: {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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