Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
feat(changlang): changLang
Browse files Browse the repository at this point in the history
changLang

fix #318
  • Loading branch information
wpxp123456 committed Dec 9, 2020
1 parent 650a1cd commit cbc81e9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/zh/guide/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2498,6 +2498,16 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开

------------

### changLang([lang])

- **说明**

传入目标语言,切换到对应的语言界面

- **参数**

+ {String} [lang]: 语言类型;暂支持`"zh"`、`"en"`、`"es"`;默认为`"zh"`;

### getRangeByTxt([txt])

- **说明**
Expand Down
16 changes: 16 additions & 0 deletions src/global/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -5934,6 +5934,22 @@ export function toJson(){
return toJsonOptions;
}


/**
* 传入目标语言,切换到对应的语言界面
* @param {String} lang 可选参数;暂支持`"zh"`、`"en"`、`"es"`;默认为`"zh"`;
*/
export function changLang(lang = 'zh'){
if(!['zh', 'en', 'es'].includes(lang)){
return tooltip.info("The lang parameter is invalid.", "");
}

let options = toJson();
options.lang = lang;
luckysheet.create(options);
}


/**
* 根据范围字符串转换为range数组
* @param {String} txt 范围字符串
Expand Down

0 comments on commit cbc81e9

Please sign in to comment.