bitcooo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

106 lines
1.9 KiB

<template>
<view class="">
<navigation :showBack="true" :bgnum="true">
Language
</navigation>
<view class="main">
<view class="main_con">
<u-radio-group v-model="value" @change="radioGroupChange">
<view class="item flex" v-for="(item, index) in list" :key="index" @click="handove('en')">
<view class="text1">
{{item.lang}}
</view>
<u-radio
@change="radioChange"
:name="item.name"
:disabled="item.disabled"
active-color="#5B53FF"
>
</u-radio>
</view>
</u-radio-group>
<view class="select_btn">
Select
</view>
</view>
</view>
</view>
</template>
<script>
import cont from "@/components/navigation/navigation.vue"
export default {
data() {
return {
checked: false,
list: [
{
lang:'USD',
disabled: false,
name:"b"
},
{
lang:'JPY',
disabled: false,
name:"a"
},
{
lang:'EUR',
disabled: false,
name:"c"
},
],
// u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
value: '',
};
},
methods: {
handove(item){
// if(item){
// }
this.$i18n.locale = item;
// #ifdef APP-PLUS
plus.storage.setItem('locale', item);
// #endif
// #ifdef H5
localStorage.setItem('locale', item);
// #endif
},
radioChange(e) {
// console.log(e);
},
// 选中任一radio时,由radio-group触发
radioGroupChange(e) {
// console.log(e);
},
change(status) {
// console.log(status);
},
},
computed: {
i18n() {
return this.$t('index')
}
},
};
</script>
<style scoped>
page {
background: #FAFAFA;
}
</style>
<style>
@import './index.css';
</style>