Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
75a27954
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5992
Star
90
Fork
162
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
75a27954
编写于
9月 11, 2024
作者:
DCloud-WZF
💬
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of gitcode.net:dcloud/hello-uni-app-x into dev
上级
f8324a89
067fee4a
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
28 addition
and
33 deletion
+28
-33
uni_modules/native-button/changelog.md
uni_modules/native-button/changelog.md
+0
-0
uni_modules/native-button/components/native-button/native-button.uvue
...native-button/components/native-button/native-button.uvue
+17
-26
uni_modules/native-button/package.json
uni_modules/native-button/package.json
+0
-0
uni_modules/native-button/readme.md
uni_modules/native-button/readme.md
+0
-0
uni_modules/native-button/utssdk/app-android/config.json
uni_modules/native-button/utssdk/app-android/config.json
+0
-0
uni_modules/native-button/utssdk/app-android/index.uts
uni_modules/native-button/utssdk/app-android/index.uts
+5
-2
uni_modules/native-button/utssdk/app-ios/config.json
uni_modules/native-button/utssdk/app-ios/config.json
+0
-0
uni_modules/native-button/utssdk/app-ios/index.uts
uni_modules/native-button/utssdk/app-ios/index.uts
+0
-0
uni_modules/native-time-picker/changelog.md
uni_modules/native-time-picker/changelog.md
+0
-0
uni_modules/native-time-picker/components/time-picker/time-picker.uvue
...ative-time-picker/components/time-picker/time-picker.uvue
+4
-2
uni_modules/native-time-picker/package.json
uni_modules/native-time-picker/package.json
+0
-0
uni_modules/native-time-picker/readme.md
uni_modules/native-time-picker/readme.md
+0
-0
uni_modules/native-time-picker/utssdk/app-android/config.json
...modules/native-time-picker/utssdk/app-android/config.json
+0
-0
uni_modules/native-time-picker/utssdk/app-android/index.uts
uni_modules/native-time-picker/utssdk/app-android/index.uts
+2
-3
uni_modules/native-time-picker/utssdk/app-ios/config.json
uni_modules/native-time-picker/utssdk/app-ios/config.json
+0
-0
uni_modules/native-time-picker/utssdk/app-ios/index.uts
uni_modules/native-time-picker/utssdk/app-ios/index.uts
+0
-0
未找到文件。
uni_modules/
uni-
native-button/changelog.md
→
uni_modules/native-button/changelog.md
浏览文件 @
75a27954
文件已移动
uni_modules/
uni-
native-button/components/native-button/native-button.uvue
→
uni_modules/native-button/components/native-button/native-button.uvue
浏览文件 @
75a27954
<template>
<native-view @init="onviewinit" @customClick="onclick"></native-view>
</template>
<script lang="uts">
import { NativeButton } from "@/uni_modules/uni-native-button";
<native-view @init="onviewinit" @customClick="ontap"></native-view>
</template>
<script lang="uts">
import { NativeButton } from "@/uni_modules/native-button";
export default {
data() {
return {
button: null as NativeButton | null,
value
: ""
value: ""
}
},
props: {
...
...
@@ -27,30 +20,28 @@
"text": {
handler(newValue : string, oldValue : string) {
this.value = newValue
this.
button?.updateText(this.v
alue)
this.
updateText(newV
alue)
},
immediate: true
},
},
methods: {
//native-view初始化时触发此方法
onviewinit(e : UniNativeViewInitEvent) {
//获取UniNativeViewElement 传递给NativeButton插件
this.button = new NativeButton(e.detail.element);
this.button?.updateText(this.value)
this.$emit("load")
},
onclick(e: UniNativeViewEvent) {
this.button?.updateText(this.value)
},
ontap(e: UniNativeViewEvent) {
this.$emit("buttonTap", e)
},
updateText(value: string) {
this.button?.updateText(value)
}
},
unmounted() {
// #ifdef APP-IOS
// iOS平台需要主动释放 uts 实例
this.button.destroy()
// #endif
// iOS平台需要主动释放 uts 实例
this.button?.destroy()
}
}
}
</script>
<style>
</style>
uni_modules/
uni-
native-button/package.json
→
uni_modules/native-button/package.json
浏览文件 @
75a27954
文件已移动
uni_modules/
uni-
native-button/readme.md
→
uni_modules/native-button/readme.md
浏览文件 @
75a27954
文件已移动
uni_modules/
uni-
native-button/utssdk/app-android/config.json
→
uni_modules/native-button/utssdk/app-android/config.json
浏览文件 @
75a27954
文件已移动
uni_modules/
uni-
native-button/utssdk/app-android/index.uts
→
uni_modules/native-button/utssdk/app-android/index.uts
浏览文件 @
75a27954
...
...
@@ -15,7 +15,7 @@ export class NativeButton {
//限制原生Button 文案描述不自动大写
this.button?.setAllCaps(false)
//监听原生Button点击事件
this.button?.setOnClickListener(_ => {
this.button?.setOnClickListener(_ => {
const detail = {}
//构建自定义UniNativeViewEvent返回对象
const event = new UniNativeViewEvent("customClick", detail)
...
...
@@ -23,7 +23,7 @@ export class NativeButton {
this.$element.dispatchEvent(event)
})
//UniNativeViewEvent 绑定 安卓原生view
this.$element.bindAndroidView(button!);
this.$element.bindAndroidView(
this.
button!);
}
updateText(text: string) {
...
...
@@ -31,4 +31,7 @@ export class NativeButton {
this.button?.setText(text)
}
destroy(){
//数据回收
}
}
uni_modules/
uni-
native-button/utssdk/app-ios/config.json
→
uni_modules/native-button/utssdk/app-ios/config.json
浏览文件 @
75a27954
文件已移动
uni_modules/
uni-
native-button/utssdk/app-ios/index.uts
→
uni_modules/native-button/utssdk/app-ios/index.uts
浏览文件 @
75a27954
文件已移动
uni_modules/
uni
-time-picker/changelog.md
→
uni_modules/
native
-time-picker/changelog.md
浏览文件 @
75a27954
文件已移动
uni_modules/
uni
-time-picker/components/time-picker/time-picker.uvue
→
uni_modules/
native
-time-picker/components/time-picker/time-picker.uvue
浏览文件 @
75a27954
<template>
<native-view class="def-picker" @init="onviewinit" @timechanged="ontimechanged"></native-view>
<view class="def-picker">
<native-view style="width: 100%; height: 100%;" @init="onviewinit" @timechanged="ontimechanged"></native-view>
</view>
</template>
<script lang="uts">
import { NativeTimePicker } from "@/uni_modules/
uni
-time-picker";
import { NativeTimePicker } from "@/uni_modules/
native
-time-picker";
export default {
...
...
uni_modules/
uni
-time-picker/package.json
→
uni_modules/
native
-time-picker/package.json
浏览文件 @
75a27954
文件已移动
uni_modules/
uni
-time-picker/readme.md
→
uni_modules/
native
-time-picker/readme.md
浏览文件 @
75a27954
文件已移动
uni_modules/
uni
-time-picker/utssdk/app-android/config.json
→
uni_modules/
native
-time-picker/utssdk/app-android/config.json
浏览文件 @
75a27954
文件已移动
uni_modules/
uni
-time-picker/utssdk/app-android/index.uts
→
uni_modules/
native
-time-picker/utssdk/app-android/index.uts
浏览文件 @
75a27954
import
{ TimePicker } from "android.widget
"
import
TimePicker from "android.widget.TimePicker
"
export class NativeTimePicker {
$element : UniNativeViewElement;
...
...
@@ -28,5 +28,4 @@ export class NativeTimePicker {
setMinute(minute: number) {
this.picker?.setMinute(minute.toInt())
}
}
}
uni_modules/
uni
-time-picker/utssdk/app-ios/config.json
→
uni_modules/
native
-time-picker/utssdk/app-ios/config.json
浏览文件 @
75a27954
文件已移动
uni_modules/
uni
-time-picker/utssdk/app-ios/index.uts
→
uni_modules/
native
-time-picker/utssdk/app-ios/index.uts
浏览文件 @
75a27954
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录