You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
673 B
Vue
42 lines
673 B
Vue
<template>
|
|
<view>
|
|
<uni-file-picker
|
|
v-model="imageValue"
|
|
fileMediatype="image"
|
|
mode="grid"
|
|
ref="files" :auto-upload="false"
|
|
@select="select"
|
|
@progress="progress"
|
|
|
|
/>
|
|
<button @click="upload">上传文件</button>
|
|
<view v-if="fileInfo">
|
|
{{fileInfo}}
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script setup>
|
|
import {
|
|
ref
|
|
} from 'vue'
|
|
let files=ref(null);
|
|
let imageValue=ref(null);
|
|
const upload=()=>{
|
|
|
|
}
|
|
const progress=(e)=>{
|
|
console.log(e)
|
|
}
|
|
let fileInfo=ref(null);
|
|
const select=(e)=>{
|
|
console.log('-------',e)
|
|
fileInfo.value=e
|
|
fileInfo.value= JSON.stringify(fileInfo.value)
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
|
|
</style>
|