xiaokuaisong-xiaochengxu/uniapp04/pages/textone/textone.vue

95 lines
2.1 KiB
Vue
Raw Normal View History

2024-10-18 07:53:00 +00:00
<template>
2025-04-11 06:42:29 +00:00
<view class="container">
<view class="example-body">
<uni-file-picker limit="9" title="最多选择9张图片"></uni-file-picker>
</view>
<view class="example-body">
<uni-file-picker limit="9" file-mediatype="video" title="最多选择9个视频"></uni-file-picker>
</view>
<view class="example-body">
<uni-file-picker limit="5" file-mediatype="all" title="最多选择5个文件"></uni-file-picker>
</view>
<view class="example-body custom-image-box">
<text class="text">选择头像</text>
<uni-file-picker limit="1" :del-icon="false" disable-preview :imageStyles="imageStyles"
file-mediatype="image">选择</uni-file-picker>
</view>
<view class="example-body ">
<uni-file-picker readonly :value="fileLists" :imageStyles="imageStyles" file-mediatype="image">
</uni-file-picker>
<uni-file-picker readonly :value="fileLists" :listStyles="listStyles" file-mediatype="all">
</uni-file-picker>
</view>
</view>
2024-10-18 07:53:00 +00:00
</template>
<script>
2025-04-11 06:42:29 +00:00
export default {
data() {
return {
imageStyles: {
width: 64,
height: 64,
border: {
radius: '50%'
}
},
listStyles: {
// 是否显示边框
border: true,
// 是否显示分隔线
dividline: true,
// 线条样式
borderStyle: {
width: 1,
color: 'blue',
style: 'dashed',
radius: 2
}
},
fileLists: [{
url: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/shuijiao-small.jpg',
extname: 'png',
name: 'shuijiao.png'
}, {
url: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/shuijiao-small.jpg',
extname: 'png',
name: 'uniapp-logo.png'
}, {
url: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/shuijiao-small.jpg',
extname: 'png',
name: 'shuijiao.png'
}]
}
},
methods: {
2024-10-18 07:53:00 +00:00
2025-04-11 06:42:29 +00:00
}
}
2024-10-18 07:53:00 +00:00
</script>
2025-04-11 06:42:29 +00:00
<style lang="scss">
.example-body {
padding: 10px;
padding-top: 0;
}
.custom-image-box {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.text {
font-size: 14px;
color: #333;
}
</style>
2024-10-18 07:53:00 +00:00