Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
911bcb59
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5993
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看板
提交
911bcb59
编写于
10月 17, 2023
作者:
W
wanganxp
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
把draw的示例从view挪到了api的界面分类下
上级
67df3c70
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
31 addition
and
33 deletion
+31
-33
pages.json
pages.json
+9
-7
pages/API/element-draw/element-draw.uvue
pages/API/element-draw/element-draw.uvue
+17
-17
pages/component/view/view.uvue
pages/component/view/view.uvue
+0
-8
pages/tabBar/API.uvue
pages/tabBar/API.uvue
+5
-1
未找到文件。
pages.json
浏览文件 @
911bcb59
...
...
@@ -14,12 +14,6 @@
"navigationBarTitleText"
:
"view"
}
},
{
"path"
:
"pages/component/view/view-draw"
,
"style"
:
{
"navigationBarTitleText"
:
"DrawableContext"
}
},
{
"path"
:
"pages/component/scroll-view/scroll-view"
,
"style"
:
{
...
...
@@ -970,7 +964,15 @@
"path"
:
"pages/API/element-takesnapshot/element-takesnapshot"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"navigationBarTitleText"
:
"takeSnapshot"
,
"enablePullDownRefresh"
:
false
}
},
{
"path"
:
"pages/API/element-draw/element-draw"
,
"style"
:
{
"navigationBarTitleText"
:
"getDrawableContext"
,
"enablePullDownRefresh"
:
false
}
}
...
...
pages/
component/view/view
-draw.uvue
→
pages/
API/element-draw/element
-draw.uvue
浏览文件 @
911bcb59
...
...
@@ -3,14 +3,14 @@
<scroll-view style="flex: 1">
<!-- #endif -->
<view>
<view
ref
="draw-text-view" style="width: 750rpx;height: 550rpx; background-color: lightgray;margin: 30rpx 0rpx;"></view>
<view
ref
="draw-line-view" style="width: 750rpx;height: 550rpx; background-color: lightgray;margin: 30rpx 0rpx;"></view>
<view
ref
="draw-circle-view" style="width: 750rpx;height: 550rpx; background-color: lightgray;margin: 30rpx 0rpx;"></view>
<view
ref
="draw-dash-line" style="width: 750rpx;height: 550rpx; background-color: lightgray;margin: 30rpx 0rpx;"></view>
<view
ref
="draw-house" style="width: 750rpx;height: 550rpx; background-color: lightgray;margin: 30rpx 0rpx;"></view>
<view
ref
="draw-style" style="width: 750rpx;height: 550rpx; background-color: lightgray;margin: 30rpx 0rpx;"></view>
<view
ref
="draw-odd" style="width: 750rpx;height: 550rpx; background-color: lightgray;margin: 30rpx 0rpx;"></view>
<view
ref
="draw-arcto" style="width: 750rpx;height: 550rpx; background-color: lightgray;margin: 30rpx 0rpx;"></view>
<view
id
="draw-text-view" style="width: 750rpx;height: 550rpx; background-color: lightgray;margin: 30rpx 0rpx;"></view>
<view
id
="draw-line-view" style="width: 750rpx;height: 550rpx; background-color: lightgray;margin: 30rpx 0rpx;"></view>
<view
id
="draw-circle-view" style="width: 750rpx;height: 550rpx; background-color: lightgray;margin: 30rpx 0rpx;"></view>
<view
id
="draw-dash-line" style="width: 750rpx;height: 550rpx; background-color: lightgray;margin: 30rpx 0rpx;"></view>
<view
id
="draw-house" style="width: 750rpx;height: 550rpx; background-color: lightgray;margin: 30rpx 0rpx;"></view>
<view
id
="draw-style" style="width: 750rpx;height: 550rpx; background-color: lightgray;margin: 30rpx 0rpx;"></view>
<view
id
="draw-odd" style="width: 750rpx;height: 550rpx; background-color: lightgray;margin: 30rpx 0rpx;"></view>
<view
id
="draw-arcto" style="width: 750rpx;height: 550rpx; background-color: lightgray;margin: 30rpx 0rpx;"></view>
</view>
<!-- #ifdef APP -->
</scroll-view>
...
...
@@ -57,8 +57,8 @@
},
methods: {
drawText() {
let element =
(this.$refs['draw-text-view'] as Element
)
let ctx = element.getDrawableContext()
let element =
uni.getElementById('draw-text-view'
)
let ctx = element
!
.getDrawableContext()
let width = element.getBoundingClientRect().width
ctx!!.reset()
ctx!!.font = "15px"
...
...
@@ -74,7 +74,7 @@
ctx!!.update()
},
drawLines() {
let ctx =
(this.$refs['draw-line-view'] as Element)
.getDrawableContext()
let ctx =
uni.getElementById('draw-line-view')!
.getDrawableContext()
ctx!!.reset()
ctx!!.lineWidth = 10;
...
...
@@ -129,7 +129,7 @@
y += 15;
},
drawCircles() {
let ctx =
(this.$refs['draw-circle-view'] as Element)
.getDrawableContext()
let ctx =
uni.getElementById('draw-circle-view')!
.getDrawableContext()
ctx!!.reset()
// Draw shapes
for (var i = 0; i < 4; i++) {
...
...
@@ -155,7 +155,7 @@
},
drawStar() {
let ctx =
(this.$refs['draw-dash-line'] as Element)
.getDrawableContext()
let ctx =
uni.getElementById('draw-dash-line')!
.getDrawableContext()
ctx!!.reset()
ctx!!.beginPath();
var horn = 5; // 画5个角
...
...
@@ -226,7 +226,7 @@
return result
},
drawhouse() {
let ctx =
(this.$refs['draw-house'] as Element)
.getDrawableContext()
let ctx =
uni.getElementById('draw-house')!
.getDrawableContext()
ctx!!.reset()
ctx!!.lineWidth = 10;
...
...
@@ -246,7 +246,7 @@
ctx!!.update()
},
drawPoint() {
let ctx =
(this.$refs['draw-style'] as Element)
.getDrawableContext()
let ctx =
uni.getElementById('draw-style')!
.getDrawableContext()
ctx!!.reset()
for (let i = 0; i < 6; i++) {
for (let j = 0; j < 6; j++) {
...
...
@@ -265,7 +265,7 @@
ctx!!.update()
},
drawRect() {
let ctx =
(this.$refs['draw-odd'] as Element)
.getDrawableContext()
let ctx =
uni.getElementById('draw-odd')!
.getDrawableContext()
ctx!!.reset()
// Create path
ctx!!.moveTo(30, 90);
...
...
@@ -283,7 +283,7 @@
},
drawArcTo() {
let ctx =
(this.$refs['draw-arcto'] as Element)
.getDrawableContext()
let ctx =
uni.getElementById('draw-arcto')!
.getDrawableContext()
ctx!.reset()
ctx!.beginPath();
ctx!.moveTo(50, 20);
...
...
pages/component/view/view.uvue
浏览文件 @
911bcb59
...
...
@@ -12,9 +12,6 @@
<boolean-data :defaultValue="false" title="是否阻止本节点的祖先节点出现点击态" @change="change_stop_propagation_boolean"></boolean-data>
<enum-data :items="start_time_enum" title="按住后多久出现点击态" @change="radio_change_start_time_enum"></enum-data>
<enum-data :items="stay_time_enum" title="手指松开后点击态保留时间" @change="radio_change_stay_time_enum"></enum-data>
<view class="uni-padding-wrap uni-common-mt uni-common-mb">
<button class="uni-common-mt" @click="goGeneralAttribute('/pages/component/view/view-draw')">DrawableContext</button>
</view>
</view>
<!-- #ifdef APP -->
</scroll-view>
...
...
@@ -46,11 +43,6 @@ export default {
radio_change_stay_time_enum(time : number) {
this.stay_time = time
},
goGeneralAttribute(path: string) {
uni.navigateTo({
url: path,
})
},
},
}
</script>
...
...
pages/tabBar/API.uvue
浏览文件 @
911bcb59
...
...
@@ -148,9 +148,13 @@
api: ["getElementById"]
},
{
name: 'element draw',
url: 'element-draw',
api: ["Element.getDrawableContext"]
},{
name: 'element截图',
url: 'element-takesnapshot',
api: ["takeSnapshot"]
api: ["
Element.
takeSnapshot"]
},
{
name: 'node节点',
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录