Skip to content

Commit e006429

Browse files
committed
feat(specification): optimize code specification
1 parent dbf4569 commit e006429

2 files changed

Lines changed: 22 additions & 18 deletions

File tree

.eslintrc.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,32 @@ module.exports = {
1111
rules: {
1212
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
1313
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
14-
'import/extensions': 0, // import不需要写文件扩展名
15-
'import/no-unresolved': 0,
16-
'no-underscore-dangle': 0, // 无下划线
14+
'max-len': 0,
1715
camelcase: 0, // 变量可以用下划线
18-
semi: ['error', 'never'], // 无分号
19-
'no-extra-semi': 0, // 和prettier冲突
2016
'no-plusplus': 0, // 禁止使用++,--
2117
'guard-for-in': 0,
22-
'max-len': ['error', { code: 200 }],
23-
'no-use-before-define': 'off',
18+
'no-extra-semi': 0, // 和prettier冲突
19+
'import/extensions': 0, // import不需要写文件扩展名
20+
semi: ['error', 'never'], // 无分号
21+
'import/no-unresolved': 0,
2422
'no-restricted-syntax': 0,
25-
'import/no-extraneous-dependencies': ['error', { devDependencies: ['script/**/*.js'] }],
23+
'no-underscore-dangle': 0, // 无下划线
2624
'no-restricted-syntax': 0,
27-
'class-methods-use-this': 'off',
2825
'consistent-return': 'off',
29-
'arrow-parens': ['error', 'as-needed'],
26+
'max-len': ['error', { code: 200 }],
27+
'no-use-before-define': 'off',
3028
'no-prototype-builtins': 'off',
29+
'class-methods-use-this': 'off',
30+
'arrow-parens': ['error', 'as-needed'],
31+
'comma-dangle': ['error', 'only-multiline'],
32+
'no-param-reassign': ['error', { props: false }],
33+
'import/no-extraneous-dependencies': ['error', { devDependencies: ['script/**/*.js'] }],
3134
'object-curly-newline': [
3235
'error',
3336
{
3437
ImportDeclaration: 'never',
3538
},
3639
],
37-
'comma-dangle': ['error', 'only-multiline'],
38-
'no-param-reassign': ['error', { props: false }],
39-
'max-len': 0,
4040
},
4141
parserOptions: {
4242
parser: 'babel-eslint',

src/view/error-page/404.vue

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66
</template>
77

88
<script type="text/ecmascript-6">
9+
import { onMounted } from '@vue/composition-api'
10+
911
export default {
10-
mounted() {
11-
const headerHeight = 72
12-
const { clientHeight } = document.body
13-
this.$refs.container.style.height = `${clientHeight - headerHeight}px`
14-
},
12+
setup(props, ctx) {
13+
onMounted(() => {
14+
const headerHeight = 72
15+
const { clientHeight } = document.body
16+
ctx.refs.container.style.height = `${clientHeight - headerHeight}px`
17+
})
18+
}
1519
}
1620
</script>
1721

0 commit comments

Comments
 (0)