Skip to content

Commit

Permalink
remove unnecessary height calc
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Mar 4, 2016
1 parent c1f3f1f commit 37acbf4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
2 changes: 2 additions & 0 deletions shells/dev/target/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ new Vue({
template: `
<div>
<counter></counter>
<target></target>
<other></other>
</div>
`,
components: { Target, Other, Counter },
Expand Down
15 changes: 1 addition & 14 deletions src/devtools/components/ComponentInstance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{{ instance.inactive ? '(inactive)' : '' }}
</span>
</div>
<div v-if="expanded" :style="{ height: height + 'px' }">
<div v-if="expanded">
<component-instance
v-for="child in instance.children | orderBy 'inactive'"
track-by="id"
Expand All @@ -50,9 +50,6 @@ export default {
},
selected ({ components: { inspectedInstance }}) {
return this.instance.id === inspectedInstance.id
},
height ({ components: { expansionMap }}) {
return getInstanceHeight(this.instance, expansionMap)
}
},
actions: {
Expand All @@ -79,16 +76,6 @@ export default {
}
}
}
function getInstanceHeight (instance, expansionMap) {
if (expansionMap[instance.id]) {
return Number(instance.children.map(child => {
return getInstanceHeight(child, expansionMap)
})) + 22
} else {
return 0
}
}
</script>

<style lang="stylus" scoped>
Expand Down

0 comments on commit 37acbf4

Please sign in to comment.