From bcc8e921f49a425cd5a98017be849923639320c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=93=E6=96=87=E7=90=86?= <531840344@qq.com> Date: Sun, 22 Apr 2018 20:34:45 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20fixed=20#8,=20=E4=B8=AD=E6=96=87?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E4=B9=B1=E7=A0=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/components/bookmark.sass | 1 + src/views/components/bookmark.vue | 11 ++++++++--- src/views/components/setting.vue | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/views/components/bookmark.sass b/src/views/components/bookmark.sass index 49723df..c5374a0 100644 --- a/src/views/components/bookmark.sass +++ b/src/views/components/bookmark.sass @@ -21,6 +21,7 @@ cursor: pointer border-bottom: 1px solid #f2f2f2 transition: all .3s ease + user-select: none &:last-child border-bottom: 0 .logo diff --git a/src/views/components/bookmark.vue b/src/views/components/bookmark.vue index 0ea53c6..bc9a0ff 100644 --- a/src/views/components/bookmark.vue +++ b/src/views/components/bookmark.vue @@ -9,11 +9,11 @@ :options="dragOptions" ) .bookmark__item( + @contextmenu="toggleEditAction" v-for="(item, inx) in bookmarks" :key="inx" @click="onLinkTapAction(item)" @dblclick="onEditAction(item)" - @contextmenu="onContextMenuAction($event, item)" :class="{edit: edit}" ) .el-icon-close(@click.stop="onRemoveAction(item)") @@ -22,7 +22,7 @@ .text.shake-constant(v-else) {{item.name[0]}} .name span {{item.name}} - .bookmark__item(@click="edit = false" v-if="edit") + .bookmark__item(@click="toggleEditAction" v-if="edit") .el-icon-check .bookmark__item(@click="onAddAction" v-else) .el-icon-plus @@ -46,6 +46,11 @@ export default { async mounted() { this.init(); }, + watch: { + bookmarks() { + this.$refs.scrollView.refresh(); + } + }, computed: { ...mapGetters('bookmark', ['bookmarks']), bookmarkLists: { @@ -68,7 +73,7 @@ export default { this.$emit('tap', item.url); } }, - onContextMenuAction(e) { + toggleEditAction(e) { e.preventDefault(); this.edit = !this.edit; if (this.edit) { diff --git a/src/views/components/setting.vue b/src/views/components/setting.vue index b152a02..2cbcb30 100644 --- a/src/views/components/setting.vue +++ b/src/views/components/setting.vue @@ -92,7 +92,7 @@ export default { }); } }; - reader.readAsBinaryString(file); + reader.readAsText(file); } }, watch: {