dsbifvcxr458755493 2018-07-20 16:18
浏览 37

使用laravel刀片定位内部反应

I'm using Laravel localization. - https://laravel.com/docs/5.6/localization I also use react component in the blade view. Now i wish to use localization in my react component like this

return(
    <button className="btn">
      {{ __('messages.welcome') }}
    </button>
)

enter image description here

How can I make the react component call the translation?

  • 写回答

1条回答 默认 最新

  • doucan8246326 2019-05-05 21:48
    关注

    This sign {{ ]} is just for PHP. "means echo", you can not do that. You'd better use Vue.js to do it. There's two way to use translation: first: put all translation in div attributes second: use JSON API Regards

    评论

报告相同问题?

悬赏问题

  • ¥20 Keil编译时报错"no source": Error: #5: cannot open source
  • ¥50 操作系统时间无法更新
  • ¥20 Windows11, usb转hdmi,外接显示器无反应
  • ¥20 怎么在JavaFx的TableView中动态地添加数据。
  • ¥15 MFC里的工具栏按钮图标使用外部图片
  • ¥15 如何在 llama.cpp 服务器中实现用户登录功能的优化方案?(语言-c++)
  • ¥15 有会用octave 的吗,急!代做!好偿!
  • ¥15 有一套同城小程序源码,Uniapp前端,php+html+mysql后端 ,能不能教我搭建起来可以运行,我不知道怎样操作
  • ¥15 mac调用java.io接口无法在根目录生成文件
  • ¥15 java微服务节点假死,网关路由时长延迟