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

Can't use Vue-i18n in html attributes #2

Open
kecrily opened this issue Oct 5, 2021 · 0 comments
Open

Can't use Vue-i18n in html attributes #2

kecrily opened this issue Oct 5, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@kecrily
Copy link
Collaborator

kecrily commented Oct 5, 2021

<!-- FIXME: How to use vue-i18n in html attribute? -->
<input
id="title"
type="text"
autofocus="true"
placeholder="Title"
class="bg-transparent text-4xl mb-5 text-gray-500"
style="width:80%;"
>

I had tried to use

<input :placeholder="$t('editor.title')">

This should be all right, but all pages go blank, with only the background. In the console I see these errors being thrown.

[Vue warn]: Property "t" was accessed during render but is not defined on instance. 
  at <PostButton> 
  at <Header> 
  at <Default onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< undefined > > 
  at <RouterView> 
  at <App> runtime-core.esm-bundler.js:6551:16
[Vue warn]: Unhandled error during execution of render function 
  at <PostButton> 
  at <Header> 
  at <Default onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< undefined > > 
  at <RouterView> 
  at <App> runtime-core.esm-bundler.js:6551:16
Uncaught (in promise) TypeError: _ctx.t is not a function
@kecrily kecrily added the bug Something isn't working label Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant