From 7a40ccbd17ffbe3cf133916ca25604c0e9302f1e Mon Sep 17 00:00:00 2001 From: kuangpengfei <1633397286@qq.com> Date: Sat, 7 Apr 2018 23:39:29 +0800 Subject: [PATCH] =?UTF-8?q?uploader=20=E7=BB=84=E4=BB=B6=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 ++++ docs/_coverpage.md | 2 +- package.json | 2 +- src/pages/uploader/index.vue | 49 +++++++++++++++++++++++++++++++++--- 4 files changed, 52 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 68ec734..eb219b0 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,12 @@ npm run dev ### 版本日志 +#### v1.0.2 +* 基于 `mpvue 1.0.7` +* `uploader`组件增加删除功能 + #### v1.0.1 +* 基于 `mpvue 1.0.7` * 增加`swiper`组件 #### v1.0.0 diff --git a/docs/_coverpage.md b/docs/_coverpage.md index 1651fda..d0f85f3 100644 --- a/docs/_coverpage.md +++ b/docs/_coverpage.md @@ -1,6 +1,6 @@ ![logo](_img/mpvue-logo.png) -# mpvue-weui 1.0.2 +# mpvue-weui 1.0.3 > 基于 mpvue 框架,重写 WeUI diff --git a/package.json b/package.json index 1459414..488b1f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mpvue-weui", - "version": "1.0.2", + "version": "1.0.3", "description": "用 vue 写小程序,使用 mpvue 框架重写 WeUI。", "author": "kuangpengfei ", "private": false, diff --git a/src/pages/uploader/index.vue b/src/pages/uploader/index.vue index 19084ab..aa12bac 100644 --- a/src/pages/uploader/index.vue +++ b/src/pages/uploader/index.vue @@ -16,8 +16,9 @@
-
- +
+ +
@@ -61,7 +62,7 @@ export default { }, methods: { chooseImage(e) { - var _this = this; + let _this = this; wx.chooseImage({ count: 1, // 默认9 sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 @@ -85,11 +86,51 @@ export default { current: e.currentTarget.id, // 当前显示图片的http链接 urls: this.files // 需要预览的图片http链接列表 }) + }, + deleteImg(e) { + Array.prototype.indexOf = function (val) { + for (let i = 0; i < this.length; i++) { + if (this[i] == val) return i; + } + return -1; + }; + Array.prototype.remove = function (val) { + let index = this.indexOf(val); + if (index > -1) { + this.splice(index, 1); + } + }; + this.files.remove(e.currentTarget.id); } } }