36 lines
592 B
Vue
36 lines
592 B
Vue
<template>
|
|
<view>
|
|
<button @click="onClick">选图</button>
|
|
<image v-for="(item, index) in images" :key="index" :src="item"></image>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import { chooseFile } from '@/uni_modules/lime-choose-file'
|
|
export default {
|
|
data() {
|
|
return {
|
|
images: []
|
|
}
|
|
},
|
|
methods: {
|
|
onClick() {
|
|
chooseFile({
|
|
type: 'image',
|
|
success:(res)=>{
|
|
this.images = res.tempFiles.map((item) => item.path)
|
|
console.log('res', res.tempFiles)
|
|
},
|
|
fail(err){
|
|
console.log('err', err)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}
|
|
|
|
</script>
|
|
|
|
<style>
|
|
|
|
</style> |