From 6338a63fc4f7e5f79fd350d8ce322f4678e8c531 Mon Sep 17 00:00:00 2001 From: Ilkwon Sim Date: Sat, 26 Jan 2019 02:09:00 +0900 Subject: [PATCH] feat: Add $attrs to StateInspector, closes #734 (#861) This PR fixes #734 Co-authored-by: Guillaume Chau --- cypress/integration/components-tab.js | 9 +++++++++ shells/dev/target/Other.vue | 1 + shells/dev/target/Target.vue | 2 +- src/backend/index.js | 13 ++++++++++++- src/devtools/components/StateInspector.vue | 3 ++- 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/cypress/integration/components-tab.js b/cypress/integration/components-tab.js index 69048607c..0cfafedcd 100644 --- a/cypress/integration/components-tab.js +++ b/cypress/integration/components-tab.js @@ -137,4 +137,13 @@ suite('components tab', () => { expect(el.text()).to.contain('tester:

{ + cy.get('.instance .instance:nth-child(2) .arrow-wrapper').click() + cy.get('.instance .instance .instance:nth-child(1) .item-name').click() + cy.get('.right .data-wrapper').then(el => { + expect(el.text()).to.contain('$attrs') + expect(el.text()).to.contain('attr:"some-attr"') + }) + }) }) diff --git a/shells/dev/target/Other.vue b/shells/dev/target/Other.vue index 474020c6c..3dfa81203 100644 --- a/shells/dev/target/Other.vue +++ b/shells/dev/target/Other.vue @@ -18,6 +18,7 @@ const computedPropMixin = { export default { name: 'other-with-mine', + inheritAttrs: false, mixins: [computedPropMixin], provide: { foo: 'bar', diff --git a/shells/dev/target/Target.vue b/shells/dev/target/Target.vue index 6d743deb2..f0af9eb3d 100644 --- a/shells/dev/target/Target.vue +++ b/shells/dev/target/Target.vue @@ -8,7 +8,7 @@ - +