appApplet/components/choose-imgs/readme.md

44 lines
785 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

第一步:引入组件
import chooseImgOne from '@/components/choose-imgs/choose-img-one.vue';
第二步:注册组件
export default {
components:{
'choose-img':chooseImgOne
}
}
第三步:使用组件
<template>
<view>
<choose-img
showAmount="3"
:ifTitle="false"
imgR="10rpx"
imgN="9"
addNum="0"
@chooseImg="chooseImg"
></choose-img>
</view>
</template>
参数说明
showAmount一排显示多少张默认3张图
ifTitle是否显示图片标题默认不显示
imgR图片圆角默认10rpx
imgN一次选择图片张数1~9默认9
addNum哪种添加图标默认0
方法说明
export default {
methods:{
chooseImg(arrImg) {
console.log(arrImg);//返回的是数组图片
}
}
}