diff --git a/pages.json b/pages.json index 9fd6b1d83bf37aa79bd226b7eaeb0cec73279b95..2a9bd3f65a2b4bbdba941b36aa864d384782b20c 100644 --- a/pages.json +++ b/pages.json @@ -483,6 +483,14 @@ "navigationBarTitleText": "涂鸦" } }, + // #ifndef WEB + { + "path": "pages/component/native-view/native-view", + "style": { + "navigationBarTitleText": "native-view" + } + }, + // #endif { "path": "pages/tabBar/API", "style": { @@ -2751,4 +2759,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/pages/component/native-view/native-view.uvue b/pages/component/native-view/native-view.uvue new file mode 100644 index 0000000000000000000000000000000000000000..16bed9f8aa8308961e511ab026c53711940af1ba --- /dev/null +++ b/pages/component/native-view/native-view.uvue @@ -0,0 +1,48 @@ + + + + + diff --git a/uni_modules/uni-native-button/components/native-button/native-button.uvue b/uni_modules/uni-native-button/components/native-button/native-button.uvue index bfd01926365f01f9c34f4a78bf6379f64c1d42af..e3a0209fcb0e36f8a38b89996aeecda3fd3f71c1 100644 --- a/uni_modules/uni-native-button/components/native-button/native-button.uvue +++ b/uni_modules/uni-native-button/components/native-button/native-button.uvue @@ -1,6 +1,6 @@ @@ -33,12 +33,12 @@ }, }, methods: { - onObjectInit(e : UniObjectInitEvent) { + onviewinit(e : UniNativeViewInitEvent) { this.button = new NativeButton(e.detail.element); this.button?.updateText(this.value) this.$emit("load") }, - onclick(e: UniObjectCustomEvent) { + onclick(e: UniNativeViewEvent) { this.$emit("buttonTap", e) } }, diff --git a/uni_modules/uni-native-button/utssdk/app-android/index.uts b/uni_modules/uni-native-button/utssdk/app-android/index.uts index 08178dc59ddd20a7b3745128444bfaf006bf634e..449b7c173c8d3a048c39cc7ab1fa6db5b934bd97 100644 --- a/uni_modules/uni-native-button/utssdk/app-android/index.uts +++ b/uni_modules/uni-native-button/utssdk/app-android/index.uts @@ -1,9 +1,9 @@ import { Button } from "android.widget" export class NativeButton { - $element : UniObjectElement; + $element : UniNativeViewElement; - constructor(element : UniObjectElement) { + constructor(element : UniNativeViewElement) { this.$element = element; bindView(); } @@ -17,12 +17,12 @@ export class NativeButton { //监听原生Button点击事件 this.button?.setOnClickListener(_ => { const detail = {} - //构建自定义UniObjectCustomEvent返回对象 - const event = new UniObjectCustomEvent("customClick", detail) + //构建自定义UniNativeViewEvent返回对象 + const event = new UniNativeViewEvent("customClick", detail) //响应分发原生Button的点击事件 $element.dispatchEvent(event) }) - //UniObjectElement 绑定 安卓原生view + //UniNativeViewEvent 绑定 安卓原生view $element.bindAndroidView(button!); } diff --git a/uni_modules/uni-time-picker/components/time-picker/time-picker.uvue b/uni_modules/uni-time-picker/components/time-picker/time-picker.uvue index 3d5e86822c19cc2dae9d351473b67ae423daa6ce..70b77ec2370baae6d288bafc986304b4620482f4 100644 --- a/uni_modules/uni-time-picker/components/time-picker/time-picker.uvue +++ b/uni_modules/uni-time-picker/components/time-picker/time-picker.uvue @@ -1,5 +1,5 @@