Skip to content
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

feat(compiler-core): support console in template #3450

Closed
wants to merge 2 commits into from
Closed

feat(compiler-core): support console in template #3450

wants to merge 2 commits into from

Conversation

zhangenming
Copy link
Contributor

like this, now will occur "Cannot read property 'log' of undefined"

:class="[
          CELL.status,
          {
            isRight: (console.log(CELL), CELL.isRight),
          },
        ]"```

@zhangenming zhangenming changed the title Zhangenming patch 1 feat(compiler-core): support console in template (#3450) Mar 19, 2021
@posva posva changed the title feat(compiler-core): support console in template (#3450) feat(compiler-core): support console in template Mar 19, 2021
@posva
Copy link
Member

posva commented Mar 19, 2021

Since this is used in dev only, I think it makes more sense to add it on userland:

app.config.globalProperties.console = console

This was also never supported in Vue 2 and it's very rare to use console.log in templates. It usually happens in methods, computed etc

@zhangenming
Copy link
Contributor Author

zhangenming commented Mar 19, 2021

image
make sense, but... Is it a little troublesome?
A lot of users don't know this, like me

A NEW USE CASE
image
Considering merging this PR? Or close... thanks @posva

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

Successfully merging this pull request may close these issues.

2 participants