提交 56de6b7a 编写于 作者: H hdx

feat(api): 新增 uni.rpx2px 示例

上级 f7983bbb
......@@ -680,6 +680,13 @@
}
},
// #endif
{
"path": "pages/API/rpx2px/rpx2px",
"style": {
"navigationBarTitleText": "rpx2px",
"enablePullDownRefresh": false
}
},
{
"path": "pages/tabBar/CSS",
"style": {
......
<template>
<!-- #ifdef APP -->
<scroll-view class="page-scroll-view">
<!-- #endif -->
<view class="page">
<page-head :title="title"></page-head>
<view>
<view class="item">
<text class="item-k">输入:</text>
<text class="item-v">{{rpxValue}}</text>
</view>
<view class="item">
<text class="item-k">返回:</text>
<text class="item-v">{{pxValue}}px</text>
</view>
</view>
<view>
<button type="primary" @tap="rpx2px">转换</button>
</view>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<script>
export default {
data() {
return {
title: 'rpx2px',
rpxValue: 750,
pxValue: 0,
result: false
}
},
methods: {
rpx2px: function () {
this.pxValue = uni.rpx2px(this.rpxValue);
}
}
}
</script>
<style>
.page {
padding: 15px;
}
.item {
flex-direction: row;
}
.item-k {
width: 72px;
line-height: 2;
}
.item-v {
font-weight: bold;
line-height: 2;
}
</style>
......@@ -186,6 +186,10 @@
name: 'showToast轻提示框',
url: 'toast',
api: ["showToast"]
},
{
name: 'rpx2px',
url: 'rpx2px'
}
] as Page[],
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册