请问vue多语言切换怎么实现?
网友回复
可以使用vue-i18n,示例代码如下:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/vue@2.6.1.js"></script> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/vue-i18n.js"></script> <style> </style> </head> <body> <div id="app"> <p style="font-size:12px;color:#515a6e;"> {{$t('hello')}} ...
点击查看剩余70%