export default {
	data() {
		return {
			locale: 'zh-Hans',
			locales: [{
				id: 'zh-Hans',
				name: '简体中文'
			}, {
				id: 'zh-Hant',
				name: '繁体中文'
			}, {
				id: 'en',
				name: 'English'
			}, {
				id: 'ja',
				name: '日本語'
			}],
			formdata:'',
			props: {},
			eventlog: []
		};
	},
	created() {
		let lang = uni.getStorageSync("_lang");
		if (!lang)
			lang = uni.getLocale();
		this.locale = lang;
	},
	methods: {
		chglog(event, e) {
			console.log(event, e);
			if(e.com)
				delete e.com;
			this.eventlog.unshift(event + ': ' + JSON.stringify(e, null, '    '));
		},
		submitlog(e) {
			console.log(e);
			this.formdata = '<b>表单数据: </b>'+JSON.stringify(e.detail.value, null, '　');
		},
		callfun(com, fun) {
			this.getrefs(com).then(ref => {
				console.log(ref[fun]());
			});
		},
		setlocale(locale) {
			this.locale = locale;
			this.$i18n.locale = locale;
		},
	}
};