Browse Source

eslint 配置

quwangxin 3 years ago
parent
commit
f6f7af10dc

+ 2 - 1
.eslintrc.js

@@ -19,6 +19,7 @@ module.exports = {
     'no-console': 'off',
     'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
     'vue/multi-word-component-names': 'off',
-    'space-before-function-paren': 0
+    'space-before-function-paren': 0,
+    'no-unused-vars': 0
   }
 };

+ 7 - 7
src/components/AssetTree/index.vue

@@ -70,7 +70,7 @@
       //   default: false
       // },
     },
-    data () {
+    data() {
       return {
         treeList: [],
         treeLoading: false,
@@ -79,17 +79,17 @@
         currentKey: ''
       };
     },
-    mounted () {
+    mounted() {
       if (this.init) {
         this.getTreeData();
       }
     },
     methods: {
-      getInstance () {
+      getInstance() {
         return this.$refs.tree;
       },
       // 获取树结构数据
-      async getTreeData () {
+      async getTreeData() {
         try {
           this.treeLoading = true;
           const requestApi =
@@ -142,17 +142,17 @@
       //   return data;
       // },
 
-      handleNodeClick (data, node) {
+      handleNodeClick(data, node) {
         this.$emit('handleNodeClick', data, node);
       },
       // 设置默认高亮行
-      setCurrentKey (id) {
+      setCurrentKey(id) {
         this.currentKey = id;
         this.$refs.tree.setCurrentKey(this.currentKey);
       },
 
       // 获取树的选中状态
-      getSelectList () {
+      getSelectList() {
         const selectList = this.$refs.tree.getCurrentNode();
         return selectList;
       }

+ 10 - 10
src/layout/components/header-notice.vue

@@ -109,7 +109,7 @@
   import { getUnreadNotice } from '@/api/layout';
 
   export default {
-    data () {
+    data() {
       return {
         // 是否显示
         visible: false,
@@ -125,28 +125,28 @@
     },
     computed: {
       // 通知标题
-      noticeTitle () {
+      noticeTitle() {
         return '通知' + (this.notice.length ? `(${this.notice.length})` : '');
       },
       // 私信标题
-      letterTitle () {
+      letterTitle() {
         return '私信' + (this.letter.length ? `(${this.letter.length})` : '');
       },
       // 待办标题
-      todoTitle () {
+      todoTitle() {
         return '待办' + (this.todo.length ? `(${this.todo.length})` : '');
       },
       // 未读数量
-      unreadNum () {
+      unreadNum() {
         return this.notice.length + this.letter.length + this.todo.length;
       }
     },
-    created () {
+    created() {
       this.query();
     },
     methods: {
       /* 查询数据 */
-      query () {
+      query() {
         getUnreadNotice()
           .then((result) => {
             this.notice = result.notice;
@@ -158,15 +158,15 @@
           });
       },
       /* 清空通知 */
-      clearNotice () {
+      clearNotice() {
         this.notice = [];
       },
       /* 清空通知 */
-      clearLetter () {
+      clearLetter() {
         this.letter = [];
       },
       /* 清空通知 */
-      clearTodo () {
+      clearTodo() {
         this.todo = [];
       }
     }

+ 5 - 5
src/layout/components/header-tools.vue

@@ -73,7 +73,7 @@
       // 是否是全屏
       fullscreen: Boolean
     },
-    data () {
+    data() {
       return {
         // 是否显示修改密码弹窗
         passwordVisible: false,
@@ -83,13 +83,13 @@
     },
     computed: {
       // 当前用户信息
-      loginUser () {
+      loginUser() {
         return this.$store.state.user.info;
       }
     },
     methods: {
       /* 用户信息下拉点击事件 */
-      onUserDropClick (command) {
+      onUserDropClick(command) {
         if (command === 'password') {
           this.passwordVisible = true;
         } else if (command === 'profile') {
@@ -114,11 +114,11 @@
         }
       },
       /* 全屏切换 */
-      toggleFullscreen () {
+      toggleFullscreen() {
         this.$emit('fullscreen');
       },
       /* 打开设置抽屉 */
-      openSetting () {
+      openSetting() {
         this.settingVisible = true;
       }
     }

+ 4 - 4
src/layout/components/password-modal.vue

@@ -51,7 +51,7 @@
     props: {
       visible: Boolean
     },
-    data () {
+    data() {
       return {
         // 按钮 loading
         loading: false,
@@ -97,11 +97,11 @@
     },
     methods: {
       /* 修改 visible */
-      updateVisible (value) {
+      updateVisible(value) {
         this.$emit('update:visible', value);
       },
       /* 保存修改 */
-      save () {
+      save() {
         this.$refs.form.validate((valid) => {
           if (valid) {
             this.loading = true;
@@ -123,7 +123,7 @@
         });
       },
       /* 关闭回调 */
-      onClose () {
+      onClose() {
         this.form = {
           oldPassword: '',
           newPassword: '',