语言设定小插件
							parent
							
								
									b9aa720bea
								
							
						
					
					
						commit
						18ea8a4366
					
				|  | @ -18,6 +18,7 @@ import util from '@/libs/util' | ||||||
| 
 | 
 | ||||||
| import * as filters from '@/utils/filters' // global filter
 | import * as filters from '@/utils/filters' // global filter
 | ||||||
| import liliDialog from '@/views/lili-dialog' | import liliDialog from '@/views/lili-dialog' | ||||||
|  | import i18nBox from '@/views/lili-components/i18n-translate' | ||||||
| import {md5} from '@/utils/md5.js'; | import {md5} from '@/utils/md5.js'; | ||||||
| Vue.config.devtools = true; | Vue.config.devtools = true; | ||||||
| Vue.config.productionTip = false | Vue.config.productionTip = false | ||||||
|  | @ -35,6 +36,7 @@ Vue.use(ViewUI, { | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| Vue.component('liliDialog',liliDialog) | Vue.component('liliDialog',liliDialog) | ||||||
|  | Vue.component('i18nBox',i18nBox) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -0,0 +1,51 @@ | ||||||
|  | <template> | ||||||
|  |   <div> | ||||||
|  |     <Button @click="enable = true">语言设定</Button> | ||||||
|  |     <Modal v-model="enable" draggable sticky scrollable :mask="false" :title="title"> | ||||||
|  |       <div> | ||||||
|  |         <RadioGroup v-model="language"> | ||||||
|  |           <Radio :label="item.value || item.label" :key="index" v-for="(item,index) in data"> | ||||||
|  |             <span>{{item.title || item.name}}</span> | ||||||
|  |           </Radio> | ||||||
|  |         </RadioGroup> | ||||||
|  |       </div> | ||||||
|  | 
 | ||||||
|  |     </Modal> | ||||||
|  |   </div> | ||||||
|  | </template> | ||||||
|  | 
 | ||||||
|  | <script> | ||||||
|  | export default { | ||||||
|  |   /** | ||||||
|  |    * data 循环的语言内容格式 [{'title':'test','value':'val'}] | ||||||
|  |    */ | ||||||
|  |   props: { | ||||||
|  |     data: { | ||||||
|  |       type: Array, | ||||||
|  |       default: () => { | ||||||
|  |         return []; | ||||||
|  |       }, | ||||||
|  |     }, | ||||||
|  |   }, | ||||||
|  |   watch: { | ||||||
|  |     /** | ||||||
|  |      * 回调语言内容 | ||||||
|  |      */ | ||||||
|  |     language(val) { | ||||||
|  |       if (val) { | ||||||
|  |         this.$emit("language", val); | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |   }, | ||||||
|  |   data() { | ||||||
|  |     return { | ||||||
|  |       language: "", //语言值 | ||||||
|  |       enable: false, //是否开启modal | ||||||
|  |       title: "转换语言", | ||||||
|  |     }; | ||||||
|  |   }, | ||||||
|  | }; | ||||||
|  | </script> | ||||||
|  | 
 | ||||||
|  | <style lang="scss" scoped> | ||||||
|  | </style> | ||||||
|  | @ -18,6 +18,7 @@ import { | ||||||
| } from "@/libs/axios"; | } from "@/libs/axios"; | ||||||
| import { setStore, getStore, removeStore } from "@/libs/storage"; | import { setStore, getStore, removeStore } from "@/libs/storage"; | ||||||
| 
 | 
 | ||||||
|  | import i18nBox from '@/views/lili-components/i18n-translate' | ||||||
| import util from "@/libs/util"; | import util from "@/libs/util"; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -34,7 +35,7 @@ Vue.use(VueLazyload, { | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| Vue.use(ViewUI); | Vue.use(ViewUI); | ||||||
| 
 | Vue.component('i18nBox',i18nBox) | ||||||
| Vue.component("vue-qr", vueQr); //此处将vue-qr添加为全局组件
 | Vue.component("vue-qr", vueQr); //此处将vue-qr添加为全局组件
 | ||||||
| 
 | 
 | ||||||
| // 挂载全局使用的方法
 | // 挂载全局使用的方法
 | ||||||
|  |  | ||||||
|  | @ -0,0 +1,51 @@ | ||||||
|  | <template> | ||||||
|  |   <div> | ||||||
|  |     <Button @click="enable = true">语言设定</Button> | ||||||
|  |     <Modal v-model="enable" draggable sticky scrollable :mask="false" :title="title"> | ||||||
|  |       <div> | ||||||
|  |         <RadioGroup v-model="language"> | ||||||
|  |           <Radio :label="item.value || item.label" :key="index" v-for="(item,index) in data"> | ||||||
|  |             <span>{{item.title || item.name}}</span> | ||||||
|  |           </Radio> | ||||||
|  |         </RadioGroup> | ||||||
|  |       </div> | ||||||
|  | 
 | ||||||
|  |     </Modal> | ||||||
|  |   </div> | ||||||
|  | </template> | ||||||
|  | 
 | ||||||
|  | <script> | ||||||
|  | export default { | ||||||
|  |   /** | ||||||
|  |    * data 循环的语言内容格式 [{'title':'test','value':'val'}] | ||||||
|  |    */ | ||||||
|  |   props: { | ||||||
|  |     data: { | ||||||
|  |       type: Array, | ||||||
|  |       default: () => { | ||||||
|  |         return []; | ||||||
|  |       }, | ||||||
|  |     }, | ||||||
|  |   }, | ||||||
|  |   watch: { | ||||||
|  |     /** | ||||||
|  |      * 回调语言内容 | ||||||
|  |      */ | ||||||
|  |     language(val) { | ||||||
|  |       if (val) { | ||||||
|  |         this.$emit("language", val); | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |   }, | ||||||
|  |   data() { | ||||||
|  |     return { | ||||||
|  |       language: "", //语言值 | ||||||
|  |       enable: false, //是否开启modal | ||||||
|  |       title: "转换语言", | ||||||
|  |     }; | ||||||
|  |   }, | ||||||
|  | }; | ||||||
|  | </script> | ||||||
|  | 
 | ||||||
|  | <style lang="scss" scoped> | ||||||
|  | </style> | ||||||
		Loading…
	
		Reference in New Issue