瀏覽代碼

linkeditable save bug fix

bach 1 月之前
父節點
當前提交
6fb04ede84
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      src/components/editable/LinkEditable.vue

+ 6 - 2
src/components/editable/LinkEditable.vue

@@ -71,12 +71,16 @@ export default {
         const $li = this.$refs.links_list.children[i];
         if ($li.querySelector('input.url').value) {
           let title = $li.querySelector('input.title').value;
-          let url = $li.querySelector('input.url').value; 
+          let url = $li.querySelector('input.url').value;
+          console.log(`title ${title}, url ${url}`);
           list.push({
             title: title,
             uri: url
           });
-          tobesaved = (typeof this.links[i] === 'undefined' || title !== this.links[i].title || url !== this.links[i].url);
+          console.log(`title ${title} | this.links[i].title ${this.links[i].title}`);
+          if (!tobesaved) {
+            tobesaved = (typeof this.links[i] === 'undefined' || title !== this.links[i].title || url !== this.links[i].url);
+          }
         }
       }
       if (!tobesaved) {