支持从图像库选择头像 >[info] 显示效果 ![](https://img.kancloud.cn/fb/05/fb056b8426af4859d393de247a2ceaba_980x270.png) >[info] 示例代码 ``` <template> <draggable-image-list :items="imageItems" @chosedImage="chosedImage" @end="end" @onRemove="onRemove"></draggable-image-list> </template> <script> import draggableImageList from "@/components/draggable_image_list"; export default { components: { draggableImageList, }, computed: {}, data () { return { imageItems: [ { id: 0, path: "attachment/image/156691643755464.jpg" }, { id: 1, path: "attachment/image/156691644208066.png" }, { id: 2, path: "attachment/image/156691650779637.png" }, ], }; }, methods: { chosedImage (chosen) { this.imageItems.push(chosen); }, end (items) { this.imageItems = items; }, onRemove (id) { this.imageItems.splice( this.imageItems.findIndex((v) => v.id === id), 1 ); }, } }; </script> ``` >[info] 属性说明 imageItems:Array 对像数组,格式: ``` [ { id: 0, path: "attachment/image/156691643755464.jpg" }, { id: 1, path: "attachment/image/156691644208066.png" }, { id: 2, path: "attachment/image/156691650779637.png" } ] ``` >[info] 事件说明 ``` chosedImage:选中图片之后回调事件,回传参数: { id:xxx, path:xxx } onRemove:删除回调事件,回传参数 id end:排序结束回调事件 ```