Merge branch 'ciderapp:main' into main

This commit is contained in:
Maikiwi 2022-01-31 22:10:36 -08:00 committed by GitHub
commit 85bfdb0d5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -340,6 +340,15 @@ const app = new Vue({
},
},
methods: {
stringTemplateParser(expression, valueObj) {
const templateMatcher = /{{\s?([^{}\s]*)\s?}}/g;
let text = expression.replace(templateMatcher, (substring, value, index) => {
value = valueObj[value];
return value;
});
return text
// stringTemplateParser('my name is {{name}} and age is {{age}}', {name: 'Tom', age:100})
},
setLz(lang) {
if(lang == "") {
lang = this.cfg.general.language