未验证 提交 4643603a 编写于 作者: O openharmony_ci 提交者: Gitee

!23654 arkts 告警清理monthly

Merge pull request !23654 from 耿文广/monthly_20230815
...@@ -296,5 +296,14 @@ struct MyComponent { ...@@ -296,5 +296,14 @@ struct MyComponent {
2. 对于\@State来说,命名参数机制传递的值并不是必选的,如果没有命名参数传值,则使用本地初始化的默认值: 2. 对于\@State来说,命名参数机制传递的值并不是必选的,如果没有命名参数传值,则使用本地初始化的默认值:
```ts ```ts
MyComponent({ count: 1, increaseBy: 2 }) class C1 {
public count:number;
public increaseBy:number;
constructor(count: number, increaseBy:number) {
this.count = count;
this.increaseBy = increaseBy;
}
}
let obj = new C1(1, 2)
MyComponent(obj)
``` ```
...@@ -103,7 +103,7 @@ export { MainPage } from './src/main/ets/components/MainPage/MainPage' ...@@ -103,7 +103,7 @@ export { MainPage } from './src/main/ets/components/MainPage/MainPage'
```js ```js
// library/src/main/ts/test.ets // library/src/main/ts/test.ets
export class Log { export class Log {
static info(msg) { static info(msg: string) {
console.info(msg); console.info(msg);
} }
} }
......
...@@ -136,13 +136,14 @@ setHapModuleUpgradeFlag(bundleName: string, moduleName: string, upgradeFlag: Upg ...@@ -136,13 +136,14 @@ setHapModuleUpgradeFlag(bundleName: string, moduleName: string, upgradeFlag: Upg
```js ```js
import freeInstall from '@ohos.bundle.freeInstall'; import freeInstall from '@ohos.bundle.freeInstall';
import { BusinessError } from '@ohos.base';
let bundleName = 'com.example.myapplication'; let bundleName = 'com.example.myapplication';
let moduleName = 'entry'; let moduleName = 'entry';
let upgradeFlag = freeInstall.UpgradeFlag.SINGLE_UPGRADE; let upgradeFlag = freeInstall.UpgradeFlag.SINGLE_UPGRADE;
try { try {
freeInstall.setHapModuleUpgradeFlag(bundleName, moduleName, upgradeFlag).then(() => { freeInstall.setHapModuleUpgradeFlag(bundleName, moduleName, upgradeFlag).then(() => {
console.info('Operation succeed') console.info('Operation succeed')
}).catch(err => { }).catch((err: BusinessError) => {
console.error('Operation failed:' + JSON.stringify(err)); console.error('Operation failed:' + JSON.stringify(err));
}); });
} catch (err) { } catch (err) {
...@@ -236,12 +237,13 @@ isHapModuleRemovable(bundleName: string, moduleName: string): Promise\<boolean>; ...@@ -236,12 +237,13 @@ isHapModuleRemovable(bundleName: string, moduleName: string): Promise\<boolean>;
```js ```js
import freeInstall from '@ohos.bundle.freeInstall'; import freeInstall from '@ohos.bundle.freeInstall';
import { BusinessError } from '@ohos.base';
let bundleName = 'com.example.myapplication'; let bundleName = 'com.example.myapplication';
let moduleName = 'entry'; let moduleName = 'entry';
try { try {
freeInstall.isHapModuleRemovable(bundleName, moduleName).then(data => { freeInstall.isHapModuleRemovable(bundleName, moduleName).then(data => {
console.info('Operation succeed:' + JSON.stringify(data)); console.info('Operation succeed:' + JSON.stringify(data));
}).catch(err => { }).catch((err: BusinessError) => {
console.error('Operation failed:' + JSON.stringify(err)); console.error('Operation failed:' + JSON.stringify(err));
}); });
} catch (err) { } catch (err) {
...@@ -332,12 +334,13 @@ getBundlePackInfo(bundleName: string, bundlePackFlag : BundlePackFlag): Promise\ ...@@ -332,12 +334,13 @@ getBundlePackInfo(bundleName: string, bundlePackFlag : BundlePackFlag): Promise\
```js ```js
import freeInstall from '@ohos.bundle.freeInstall'; import freeInstall from '@ohos.bundle.freeInstall';
import { BusinessError } from '@ohos.base';
let bundleName = 'com.example.myapplication'; let bundleName = 'com.example.myapplication';
let bundlePackFlag = freeInstall.BundlePackFlag.GET_PACK_INFO_ALL; let bundlePackFlag = freeInstall.BundlePackFlag.GET_PACK_INFO_ALL;
try { try {
freeInstall.getBundlePackInfo(bundleName, bundlePackFlag).then(data => { freeInstall.getBundlePackInfo(bundleName, bundlePackFlag).then(data => {
console.info('Operation succeed:' + JSON.stringify(data)); console.info('Operation succeed:' + JSON.stringify(data));
}).catch(err => { }).catch((err: BusinessError) => {
console.error('Operation failed:' + JSON.stringify(err)); console.error('Operation failed:' + JSON.stringify(err));
}); });
} catch (err) { } catch (err) {
...@@ -402,10 +405,11 @@ getDispatchInfo(): Promise\<DispatchInfo>; ...@@ -402,10 +405,11 @@ getDispatchInfo(): Promise\<DispatchInfo>;
```js ```js
import freeInstall from '@ohos.bundle.freeInstall'; import freeInstall from '@ohos.bundle.freeInstall';
import { BusinessError } from '@ohos.base';
try { try {
freeInstall.getDispatchInfo().then(data => { freeInstall.getDispatchInfo().then(data => {
console.info('Operation succeed:' + JSON.stringify(data)); console.info('Operation succeed:' + JSON.stringify(data));
}).catch(err => { }).catch((err: BusinessError) => {
console.error('Operation failed:' + JSON.stringify(err)); console.error('Operation failed:' + JSON.stringify(err));
}); });
} catch (err) { } catch (err) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册