控件在uniapp中只能半屏显示,在h5中正常,代码如下:<template>
<view class="pb-130rpx pt-20rpx">
<piaoyi-editor :readOnly="readOnly" :photoUrl="photoUrl" :api="api" :values="values" :maxlength="maxlength" :placeholder="placeholder" @changes="saveContent" />
<view class="box-border bg-white bottom-0 shadow-[0_-1px_5px_rgba(0,0,0,0.1)] text-#606266 h-120rpx left-0 py-20rpx px-30rpx fixed w-full z-995">
<view @tap="submit" class="box-border bg-#fa436a text-white leading-40rpx py-20rpx text-center w-full">保存</view>
</view>
</view>
</template>

4***@qq.com
- 发布:2025-05-23 09:49
- 更新:2025-05-23 11:31
- 阅读:28
2 个回复
DCloud_UNI_yuhe
你好,请提供完整的复现代码,并详细说明你的问题
4***@qq.com (作者)
<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationBarTitleText: '内容',
},
}
</route>
<template>
<view class="pb-130rpx pt-20rpx">
<piaoyi-editor :readOnly="readOnly" :photoUrl="photoUrl" :api="api" :values="values" :maxlength="maxlength" :placeholder="placeholder" @changes="saveContent" />
<view class="box-border bg-white bottom-0 shadow-[0_-1px_5px_rgba(0,0,0,0.1)] text-#606266 h-120rpx left-0 py-20rpx px-30rpx fixed w-full z-995">
<view @tap="submit" class="box-border bg-#fa436a text-white leading-40rpx py-20rpx text-center w-full">保存</view>
</view>
</view>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import PiaoyiEditor from '@/uni_modules/piaoyi-editor/components/piaoyi-editor/piaoyi-editor.vue'
const readOnly = ref(false)
const values = ref('')
const txt = ref('')
const photoUrl = ref('http://xxx.com')
const api = ref('/Upload/upload')
const placeholder = ref('请输入内容')
const maxlength = ref(3000)
const oldData = ref('')
onLoad((options) => {
const decodedContent = decodeURIComponent(options.content || '')
values.value = decodedContent
oldData.value = decodedContent
console.log('this.values', values.value)
})
const saveContent = (event: any) => {
txt.value = event.html
}
const submit = () => {
}
</script>
<style>
/ 你的css /
</style>
得到的图见附件h5已经标注,微信小程序模拟器跟真机一样下效果。
使用的unocss如下:
"unocss": "^0.58.9",
"unocss-applet": "^0.7.8",