上传代码
This commit is contained in:
94
uniapp04/pages/textone/textone.vue
Normal file
94
uniapp04/pages/textone/textone.vue
Normal file
@ -0,0 +1,94 @@
|
||||
<template>
|
||||
<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>
|
||||
</template>
|
||||
<script>
|
||||
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: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<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>
|
||||
|
Reference in New Issue
Block a user