badigard
badigard

Reputation: 850

VueJS - replace text in DOM

I am using elementUI's pagination component in my VueJS app.

I wish to replace the default 'Go to' text to 'Page' without altering the inner div:

<span class="el-pagination__jump">
   Go to
   <div class="el-input el-pagination__editor is-in-pagination">
      <!----><input type="number" autocomplete="off" min="1" max="6" class="el-input__inner"><!----><!----><!---->
   </div>
</span>

How can I do this? Do I have access to the DOM?

Thanks.

Upvotes: 0

Views: 347

Answers (1)

IVO GELOV
IVO GELOV

Reputation: 14269

You can play with the localization settings. Since the default locale is Chinese, I assume you are already doing this in your main.js

import localeUI from 'element-ui/lib/locale'
import defaultLang from 'element-ui/lib/locale/lang/en' 
localeUI.use(defaultLang); 

So you have to clone the English locale, modify the el.pagination.goto value and then use this new locale.

Upvotes: 1

Related Questions