Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
87c9d731
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6399
Star
111
Fork
187
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
24
列表
看板
标记
里程碑
合并请求
2
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
24
Issue
24
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
87c9d731
编写于
4月 17, 2024
作者:
DCloud_iOS_XHY
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
遴选dev之前提交的 commit
上级
780b68ee
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
19 addition
and
1 deletion
+19
-1
pages/API/element-draw/element-draw.uvue
pages/API/element-draw/element-draw.uvue
+1
-1
pages/CSS/background/background-image.uvue
pages/CSS/background/background-image.uvue
+2
-0
pages/CSS/transition/transition.uvue
pages/CSS/transition/transition.uvue
+16
-0
未找到文件。
pages/API/element-draw/element-draw.uvue
浏览文件 @
87c9d731
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
let ctx = element.getDrawableContext()!
let ctx = element.getDrawableContext()!
let width = element.getBoundingClientRect().width
let width = element.getBoundingClientRect().width
ctx.reset()
ctx.reset()
ctx.font = "15px"
ctx.font = "15px
Arial
"
ctx.textAlign = "center"
ctx.textAlign = "center"
for (var i = 0; i < this.texts.length; i++) {
for (var i = 0; i < this.texts.length; i++) {
let value = this.texts[i]
let value = this.texts[i]
...
...
pages/CSS/background/background-image.uvue
浏览文件 @
87c9d731
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
<scroll-view style="flex:1">
<scroll-view style="flex:1">
<!-- #endif -->
<!-- #endif -->
<view>
<view>
// iOS平台宽高为0时,设置渐变色会不会导致闪退
<view style="width: 0px; height: 0px; background-image: linear-gradient(to bottom,#f5f5f5,#eff2f5);"></view>
<text>不支持背景图片,仅支持linear-gradient方法</text>
<text>不支持背景图片,仅支持linear-gradient方法</text>
<view v-for="(direction) in directionData">
<view v-for="(direction) in directionData">
<text>background-image: linear-gradient({{direction}}, red, yellow)</text>
<text>background-image: linear-gradient({{direction}}, red, yellow)</text>
...
...
pages/CSS/transition/transition.uvue
浏览文件 @
87c9d731
...
@@ -25,6 +25,12 @@
...
@@ -25,6 +25,12 @@
<text class="text">点击修改Background</text>
<text class="text">点击修改Background</text>
<view class="base-style transition-background" id="styleBackground" @click="changeBackground"></view>
<view class="base-style transition-background" id="styleBackground" @click="changeBackground"></view>
</view>
</view>
<view class="container">
<text class="text">点击修改Background(颜色带透明度)</text>
<view style="flex: 1;">
<view class="base-style transition-background" id="styleBackground2" @click="changeBackground2"></view>
</view>
</view>
<view class="container">
<view class="container">
<text class="text">动态修改Background</text>
<text class="text">动态修改Background</text>
<view class="base-style" id="propertyStyleBackground" @click="propertyChangeBackground"></view>
<view class="base-style" id="propertyStyleBackground" @click="propertyChangeBackground"></view>
...
@@ -73,6 +79,7 @@
...
@@ -73,6 +79,7 @@
stylePadding: null as UniElement | null,
stylePadding: null as UniElement | null,
isTransitionstyleBackground: false,
isTransitionstyleBackground: false,
styleBackground: null as UniElement | null,
styleBackground: null as UniElement | null,
styleBackground2: null as UniElement | null,
isTransitionStyleTransform: false,
isTransitionStyleTransform: false,
styleTransform: null as UniElement | null,
styleTransform: null as UniElement | null,
isTransitionStyleTransformWithWidth:false,
isTransitionStyleTransformWithWidth:false,
...
@@ -96,6 +103,7 @@
...
@@ -96,6 +103,7 @@
this.styleMargin = uni.getElementById("styleMargin")
this.styleMargin = uni.getElementById("styleMargin")
this.stylePadding = uni.getElementById("stylePadding")
this.stylePadding = uni.getElementById("stylePadding")
this.styleBackground = uni.getElementById("styleBackground")
this.styleBackground = uni.getElementById("styleBackground")
this.styleBackground2 = uni.getElementById("styleBackground2")
this.styleTransform = uni.getElementById("styleTransform")
this.styleTransform = uni.getElementById("styleTransform")
this.styleBorder = uni.getElementById("styleBorder")
this.styleBorder = uni.getElementById("styleBorder")
this.stylePosition = uni.getElementById("stylePosition")
this.stylePosition = uni.getElementById("stylePosition")
...
@@ -147,6 +155,14 @@
...
@@ -147,6 +155,14 @@
)
)
this.isTransitionstyleBackground = !this.isTransitionstyleBackground
this.isTransitionstyleBackground = !this.isTransitionstyleBackground
},
},
changeBackground2() {
console.log(aa)
this.styleBackground2?.style?.setProperty("background-color", this.isTransitionstyleBackground
? 'brown'
: 'rgba(0, 0, 0, 0.5);'
)
this.isTransitionstyleBackground = !this.isTransitionstyleBackground
},
propertyChangeBackground() {
propertyChangeBackground() {
if (!this.isSetTransition) {
if (!this.isSetTransition) {
this.propertyStyleBackground?.style?.setProperty("transition-property", "background-color")
this.propertyStyleBackground?.style?.setProperty("transition-property", "background-color")
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录