File tree Expand file tree Collapse file tree 2 files changed +52
-2
lines changed Expand file tree Collapse file tree 2 files changed +52
-2
lines changed Original file line number Diff line number Diff line change 2
2
pageClass : rule-details
3
3
sidebarDepth : 0
4
4
title : vue/no-use-computed-property-like-method
5
- description : disallow use computed properties like methods
5
+ description : disallow use computed property like method
6
6
---
7
+
8
+ # vue/no-use-computed-property-like-method
9
+ > disallow use computed property like method
10
+
11
+ ## :book : Rule Details
12
+
13
+ This rule disallows to use computed property like method.
14
+
15
+ <eslint-code-block :rules =" {'vue/no-use-computed-property-like-method': ['error']} " >
16
+
17
+ ``` vue
18
+ <template>
19
+ <div>
20
+ </div>
21
+ </template>
22
+
23
+ <script>
24
+ export default {
25
+ props: {
26
+ name: {
27
+ type: String
28
+ },
29
+ },
30
+ computed: {
31
+ isExpectedName() {
32
+ return this.name === 'name';
33
+ }
34
+ },
35
+ methods: {
36
+ getName() {
37
+ return this.isExpectedName
38
+ },
39
+ getNameCallLikeMethod() {
40
+ return this.isExpectedName()
41
+ }
42
+ }
43
+ }
44
+ </script>
45
+ ```
46
+
47
+ </eslint-code-block >
48
+
49
+ ## :wrench : Options
50
+
51
+ Nothing.
52
+
53
+ ## :mag : Implementation
54
+
55
+ - [ Rule source] ( https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/no-use-computed-property-like-method.js )
56
+ - [ Test source] ( https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/no-use-computed-property-like-method.js )
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ module.exports = {
23
23
meta : {
24
24
type : 'problem' ,
25
25
docs : {
26
- description : 'enforce ' ,
26
+ description : 'disallow use computed property like method ' ,
27
27
categories : undefined ,
28
28
url :
29
29
'https://eslint.vuejs.org/rules/no-use-computed-property-like-method.html'
You can’t perform that action at this time.
0 commit comments