refactor: Freeze property to improve performance

This commit is contained in:
freedomlang 2019-12-05 17:18:43 +08:00 committed by Henrique Dias
parent 897ac75281
commit 12d6415f7f
1 changed files with 5 additions and 1 deletions

View File

@ -10,7 +10,7 @@ export default {
name: 'languages',
props: [ 'locale' ],
data() {
return {
let dataObj = {
locales: {
ar: 'ar',
de: 'de',
@ -32,6 +32,10 @@ export default {
'zh-tw': 'zhTW'
}
};
Object.defineProperty(dataObj, "locales", { configurable: false, writable: false });
return dataObj;
},
methods: {
change (event) {