From 197b984563afd1c473d021358fd31461711a9cf0 Mon Sep 17 00:00:00 2001 From: hekun Date: Fri, 21 Oct 2022 22:26:27 +0800 Subject: [PATCH] add js attr Signed-off-by: hekun --- .../MainAbility/pages/input/router/index.hml | 3 +++ .../js/MainAbility/pages/input/router/index.js | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/input/router/index.hml b/arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/input/router/index.hml index 680b78b45..f1a1ad0e5 100644 --- a/arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/input/router/index.hml +++ b/arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/input/router/index.hml @@ -35,4 +35,7 @@ set/delete test + + watch test + diff --git a/arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/input/router/index.js b/arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/input/router/index.js index 1336e058a..032361ce9 100644 --- a/arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/input/router/index.js +++ b/arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/input/router/index.js @@ -22,6 +22,15 @@ export default { onInit() { this.$watch("watchVal", "onwatch") }, + onConfigurationUpdated(configuration) { + console.info("the configuration is " + JSON.stringify(configuration)); + let fontScale = configuration.fontScale; + let locate = configuration.locate; + let objectLocate = locate.unicodeSetting; + console.info("the fontScale " + fontScale); + console.info("the locate is " + JSON.stringify(locate)); + console.info("the objectLocate is " + JSON.stringify(objectLocate)); + }, functionTest1() { var function1 = this.$element('function1'); var result = function1.setStyle("font-size", "50px") @@ -53,6 +62,15 @@ export default { this.$delete('Version'); // log print:Version = undefined console.info("Version = " + this.Version); + + // add new attr test + console.info("this app is = " + this.$app); + console.info("this def is = " + this.$app.$def); + }, + functionTest7() { + let input = this.$refs.refname + console.info("this refs is = " + this.$refs); + console.info("this refs is = " + input); }, onwatch(newVal, oldVal) { console.log("watch newVal = " + newVal + ",oldVal =" + oldVal) -- GitLab