Your time is limited, so don’t waste it living someone else’s life.
—— Steve Jobs
//main.js
import Vue from 'vue'
import piman from "@yasai/piman";
import '@yasai/piman/dist/piman.css';
Vue.use(piman) //Default is “zh-Hant-TW”
//Vue.use(piman,{ locale: 'en' })
// nuxt.config.js
export default {
plugins: [
'@/plugins/piman.js',
],
}
// plugins/bp-a11y.js
import Vue from 'vue'
import piman from "@yasai/piman";
Vue.use(piman) //Default is “zh-Hant-TW”
//Vue.use(piman,{ locale: 'en' })
import piman from "@yasai/piman"
piman.i18n.use({
"pagination":{
"page":"ページ"
},
})
import BpaI18n from '../locale'
export default Vue.extend({
mixins: [ BpaI18n ],
//...
})
<!-- text -->
<span>{{ t('pagination.per') }}</span>
<!-- v-bind -->
<nav
:aria-label="t('pagination.aria')"
class="bpa-pagination"
/>
//template
{{ add() }}
//script
methods: {
add(){
let text = this.t('pagination.aria')
text = text + 'Add'
return text
},
}
import piman from "@yasai/piman"
piman.i18n.use('en')
// All options
{
"pagination":{
"total":"共",
"page":"頁",
"per":"每頁",
"result":"項",
"goto":"前往",
"exceed":"噢!此頁碼不適用。",
"aria":"分頁選擇",
"input_goto":"請輸入想前往的頁面",
"first_page_text":"第一頁",
"prev_page_text":"上一頁",
"next_page_text":"下一頁",
"last_page_text":"最後一頁",
},
"form":{
"required": "必填"
},
"breadcrumb":{
"current_page":"現在頁面位置"
},
"button":{
"loading": "載入中"
},
"dialog":{
"close":"關閉燈箱"
},
"dropdown":{
"goto":"前往",
"new_tab":"另開視窗前往"
},
"input":{
"show":"點擊顯示密碼",
"hide":"點擊隱藏密碼",
"clear":"清空輸入",
"placeholder":"請輸入"
},
"msg":{
"area":"訊息區域",
"close":"關閉訊息框",
},
"select":{
"placeholder": "請選擇",
"clear":"清空下拉式選單",
"search":"搜尋",
"area_search":"請輸入關鍵字搜尋與過濾下拉式選單選項"
},
"collapse":{
"title": "標題",
},
"switch":{
"off": "關閉",
"on": "開啟"
}
}