Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
067fee4a
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6005
Star
91
Fork
164
代码
文件
提交
分支
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看板
提交
067fee4a
编写于
9月 11, 2024
作者:
shutao-dc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
uni-native-button rename native-button uni-time-picker rename native-time-picker
上级
395fc4f1
变更
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
浏览文件 @
067fee4a
文件已移动
uni_modules/
uni-
native-button/components/native-button/native-button.uvue
→
uni_modules/native-button/components/native-button/native-button.uvue
浏览文件 @
067fee4a
<template>
<template>
<native-view @init="onviewinit" @customClick="ontap"></native-view>
<native-view @init="onviewinit" @customClick="onclick"></native-view>
</template>
<script lang="uts">
</template>
import { NativeButton } from "@/uni_modules/native-button";
<script lang="uts">
import { NativeButton } from "@/uni_modules/uni-native-button";
export default {
export default {
data() {
data() {
return {
return {
button: null as NativeButton | null,
button: null as NativeButton | null,
value
: ""
value: ""
}
}
},
},
props: {
props: {
...
@@ -27,30 +20,28 @@
...
@@ -27,30 +20,28 @@
"text": {
"text": {
handler(newValue : string, oldValue : string) {
handler(newValue : string, oldValue : string) {
this.value = newValue
this.value = newValue
this.
button?.updateText(this.v
alue)
this.
updateText(newV
alue)
},
},
immediate: true
immediate: true
},
},
},
},
methods: {
methods: {
//native-view初始化时触发此方法
onviewinit(e : UniNativeViewInitEvent) {
onviewinit(e : UniNativeViewInitEvent) {
//获取UniNativeViewElement 传递给NativeButton插件
this.button = new NativeButton(e.detail.element);
this.button = new NativeButton(e.detail.element);
this.button?.updateText(this.value)
this.button?.updateText(this.value)
this.$emit("load")
},
},
ontap(e: UniNativeViewEvent) {
onclick(e: UniNativeViewEvent) {
this.$emit("buttonTap", e)
this.$emit("buttonTap", e)
},
updateText(value: string) {
this.button?.updateText(value)
}
}
},
},
unmounted() {
unmounted() {
// #ifdef APP-IOS
// iOS平台需要主动释放 uts 实例
// iOS平台需要主动释放 uts 实例
this.button?.destroy()
this.button.destroy()
// #endif
}
}
}
}
</script>
</script>
<style>
</style>
uni_modules/
uni-
native-button/package.json
→
uni_modules/native-button/package.json
浏览文件 @
067fee4a
文件已移动
uni_modules/
uni-
native-button/readme.md
→
uni_modules/native-button/readme.md
浏览文件 @
067fee4a
文件已移动
uni_modules/
uni-
native-button/utssdk/app-android/config.json
→
uni_modules/native-button/utssdk/app-android/config.json
浏览文件 @
067fee4a
文件已移动
uni_modules/
uni-
native-button/utssdk/app-android/index.uts
→
uni_modules/native-button/utssdk/app-android/index.uts
浏览文件 @
067fee4a
...
@@ -15,7 +15,7 @@ export class NativeButton {
...
@@ -15,7 +15,7 @@ export class NativeButton {
//限制原生Button 文案描述不自动大写
//限制原生Button 文案描述不自动大写
this.button?.setAllCaps(false)
this.button?.setAllCaps(false)
//监听原生Button点击事件
//监听原生Button点击事件
this.button?.setOnClickListener(_ => {
this.button?.setOnClickListener(_ => {
const detail = {}
const detail = {}
//构建自定义UniNativeViewEvent返回对象
//构建自定义UniNativeViewEvent返回对象
const event = new UniNativeViewEvent("customClick", detail)
const event = new UniNativeViewEvent("customClick", detail)
...
@@ -23,7 +23,7 @@ export class NativeButton {
...
@@ -23,7 +23,7 @@ export class NativeButton {
this.$element.dispatchEvent(event)
this.$element.dispatchEvent(event)
})
})
//UniNativeViewEvent 绑定 安卓原生view
//UniNativeViewEvent 绑定 安卓原生view
this.$element.bindAndroidView(button!);
this.$element.bindAndroidView(
this.
button!);
}
}
updateText(text: string) {
updateText(text: string) {
...
@@ -31,4 +31,7 @@ export class NativeButton {
...
@@ -31,4 +31,7 @@ export class NativeButton {
this.button?.setText(text)
this.button?.setText(text)
}
}
destroy(){
//数据回收
}
}
}
uni_modules/
uni-
native-button/utssdk/app-ios/config.json
→
uni_modules/native-button/utssdk/app-ios/config.json
浏览文件 @
067fee4a
文件已移动
uni_modules/
uni-
native-button/utssdk/app-ios/index.uts
→
uni_modules/native-button/utssdk/app-ios/index.uts
浏览文件 @
067fee4a
文件已移动
uni_modules/
uni
-time-picker/changelog.md
→
uni_modules/
native
-time-picker/changelog.md
浏览文件 @
067fee4a
文件已移动
uni_modules/
uni
-time-picker/components/time-picker/time-picker.uvue
→
uni_modules/
native
-time-picker/components/time-picker/time-picker.uvue
浏览文件 @
067fee4a
<template>
<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>
</template>
<script lang="uts">
<script lang="uts">
import { NativeTimePicker } from "@/uni_modules/
uni
-time-picker";
import { NativeTimePicker } from "@/uni_modules/
native
-time-picker";
export default {
export default {
...
...
uni_modules/
uni
-time-picker/package.json
→
uni_modules/
native
-time-picker/package.json
浏览文件 @
067fee4a
文件已移动
uni_modules/
uni
-time-picker/readme.md
→
uni_modules/
native
-time-picker/readme.md
浏览文件 @
067fee4a
文件已移动
uni_modules/
uni
-time-picker/utssdk/app-android/config.json
→
uni_modules/
native
-time-picker/utssdk/app-android/config.json
浏览文件 @
067fee4a
文件已移动
uni_modules/
uni
-time-picker/utssdk/app-android/index.uts
→
uni_modules/
native
-time-picker/utssdk/app-android/index.uts
浏览文件 @
067fee4a
import
{ TimePicker } from "android.widget
"
import
TimePicker from "android.widget.TimePicker
"
export class NativeTimePicker {
export class NativeTimePicker {
$element : UniNativeViewElement;
$element : UniNativeViewElement;
...
@@ -28,5 +28,4 @@ export class NativeTimePicker {
...
@@ -28,5 +28,4 @@ export class NativeTimePicker {
setMinute(minute: number) {
setMinute(minute: number) {
this.picker?.setMinute(minute.toInt())
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
浏览文件 @
067fee4a
文件已移动
uni_modules/
uni
-time-picker/utssdk/app-ios/index.uts
→
uni_modules/
native
-time-picker/utssdk/app-ios/index.uts
浏览文件 @
067fee4a
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录