Skip to content

slot-scope doesn't accept all valid expressions #546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
smiller171 opened this issue Apr 20, 2018 · 2 comments
Closed

slot-scope doesn't accept all valid expressions #546

smiller171 opened this issue Apr 20, 2018 · 2 comments

Comments

@smiller171
Copy link

Version

dev branch

Reproduction link

https://codesandbox.io/s/mow3jyo89j?module=%2Ftest%2Funit%2Fspecs%2FScoped-broken.spec.js&view=preview

Steps to reproduce

Access a scope with a JS expression like "{ item }" instead of "item"

What is expected?

Using "{ item }" to identify a scope should allow for accessing that variable directly instead of having to use something.item

What is actually happening?

item is not defined

ReferenceError: item is not defined
    at Object.eval (eval at createFunction (https://mow3jyo89j.codesandbox.io/node_modules/vue-template-compiler/browser.js), :3:39)
    at Proxy.vm._renderProxy._t (https://mow3jyo89j.codesandbox.io/node_modules/@millergeek/test-utils/dist/vue-test-utils.js:1931:31)
    at eval (https://mow3jyo89j.codesandbox.io/src/components/Scoped.vue?f8cd7dd6:1:334)
    at Proxy.renderList (https://mow3jyo89j.codesandbox.io/node_modules/vue/dist/vue.common.js:3707:16)
    at Proxy.render (https://mow3jyo89j.codesandbox.io/src/components/Scoped.vue?f8cd7dd6:1:273)
    at VueComponent.Vue._render (https://mow3jyo89j.codesandbox.io/node_modules/vue/dist/vue.common.js:4546:22)
    at VueComponent.updateComponent (https://mow3jyo89j.codesandbox.io/node_modules/vue/dist/vue.common.js:2790:21)
    at Watcher.get (https://mow3jyo89j.codesandbox.io/node_modules/vue/dist/vue.common.js:3144:25)
    at new Watcher (https://mow3jyo89j.codesandbox.io/node_modules/vue/dist/vue.common.js:3133:12)
    at mountComponent (https://mow3jyo89j.codesandbox.io/node_modules/vue/dist/vue.common.js:2797:3)
    at VueComponent.Vue.$mount (https://mow3jyo89j.codesandbox.io/node_modules/vue/dist/vue.common.js:8542:10)
    at VueComponent.Vue.$mount (https://mow3jyo89j.codesandbox.io/node_modules/vue/dist/vue.common.js:10941:16)
    at mount (https://mow3jyo89j.codesandbox.io/node_modules/@millergeek/test-utils/dist/vue-test-utils.js:4744:8)
    at shallow (https://mow3jyo89j.codesandbox.io/node_modules/@millergeek/test-utils/dist/vue-test-utils.js:4781:10)
    at eval (https://mow3jyo89j.codesandbox.io/test/unit/specs/Scoped-broken.spec.js:14:36)
    at s (https://codesandbox.io/static/js/sandbox.153e4095.js:2529:310)
    at o (https://codesandbox.io/static/js/sandbox.153e4095.js:2529:124)
    at evaluate (https://mow3jyo89j.codesandbox.io/test/unit/specs/Scoped-broken.spec.js:13:1)
    at r.a (https://codesandbox.io/static/js/sandbox.153e4095.js:5354:971)
    at e.value (https://codesandbox.io/static/js/sandbox.153e4095.js:5413:270)
    at e.value (https://codesandbox.io/static/js/sandbox.153e4095.js:5386:23195)
    at e.value (https://codesandbox.io/static/js/sandbox.153e4095.js:5386:22974)
    at e. (https://codesandbox.io/static/js/sandbox.153e4095.js:5386:18687)
    at n (https://codesandbox.io/static/js/common-sandbox.d83f0a59.js:2847:811)
    at Generator._invoke (https://codesandbox.io/static/js/common-sandbox.d83f0a59.js:2847:599)
    at Generator.e.(anonymous function) [as next] (https://codesandbox.io/static/js/common-sandbox.d83f0a59.js:2847:990)
    at o (https://codesandbox.io/static/js/common-sandbox.d83f0a59.js:3049:316)
    at https://codesandbox.io/static/js/common-sandbox.d83f0a59.js:3049:464
    at new Promise ()
    at new t (https://codesandbox.io/static/js/common-sandbox.d83f0a59.js:678:776)
    at https://codesandbox.io/static/js/common-sandbox.d83f0a59.js:3049:258
    at https://codesandbox.io/static/js/sandbox.153e4095.js:5386:18996
    at Array.map ()
    at e. (https://codesandbox.io/static/js/sandbox.153e4095.js:5386:18550)
    at n (https://codesandbox.io/static/js/common-sandbox.d83f0a59.js:2847:811)
    at Generator._invoke (https://codesandbox.io/static/js/common-sandbox.d83f0a59.js:2847:599)
    at Generator.e.(anonymous function) [as next] (https://codesandbox.io/static/js/common-sandbox.d83f0a59.js:2847:990)
    at o (https://codesandbox.io/static/js/common-sandbox.d83f0a59.js:3049:316)
    at https://codesandbox.io/static/js/common-sandbox.d83f0a59.js:3049:412
Console
6
Problems
4

I had to fork and build vue-test-utils myself to find this bug on the dev branch. Am happy to update with the official beta15 on Monday.

@smiller171 smiller171 changed the title slot-scope doesn't accept all valid expressions slot-scope doesn't accept all valid expressions Apr 20, 2018
@smiller171 smiller171 reopened this Apr 20, 2018
@38elements
Copy link
Contributor

I will send a pull request to resolve this issue within a day.

@eddyerburgh
Copy link
Member

This has been

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants