Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
李楚霏
/
refactorTest
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5928922d
authored
Jan 21, 2020
by
李楚霏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
task- 重命名,通过第一次测试
parent
76118ee0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
length/src/index.js
+14
-14
No files found.
length/src/index.js
View file @
5928922d
export
class
Length
{
value
unit
unitEnum
=
[
'foot'
,
'yard'
,
'inch'
]
//
unitEnum = ['foot', 'yard', 'inch']
constructor
(
val
,
uint
)
{
this
.
value
=
val
...
...
@@ -15,29 +15,29 @@ export class Length {
getUint
()
{
return
this
.
unit
}
parseTo
(
u
)
{
parseTo
(
u
nitNode
)
{
let
len
=
this
if
(
this
.
unit
===
'yard'
)
{
if
(
u
===
'f'
)
{
len
=
new
Length
(
this
.
value
*
3
,
u
)
}
else
if
(
u
===
'inch'
)
{
len
=
new
Length
(
this
.
value
*
36
,
u
)
if
(
u
nitNode
===
'f'
)
{
len
=
new
Length
(
this
.
value
*
3
,
u
nitNode
)
}
else
if
(
u
nitNode
===
'inch'
)
{
len
=
new
Length
(
this
.
value
*
36
,
u
nitNode
)
}
}
if
(
this
.
unit
===
'inch'
)
{
if
(
u
===
'yard'
)
{
len
=
new
Length
(
this
.
value
/
36
,
u
)
}
else
if
(
u
===
'f'
)
{
len
=
new
Length
(
this
.
value
/
12
,
u
)
if
(
u
nitNode
===
'yard'
)
{
len
=
new
Length
(
this
.
value
/
36
,
u
nitNode
)
}
else
if
(
u
nitNode
===
'f'
)
{
len
=
new
Length
(
this
.
value
/
12
,
u
nitNode
)
}
}
if
(
this
.
unit
===
'f'
)
{
if
(
u
===
'yard'
)
{
len
=
new
Length
(
this
.
value
/
3
,
u
)
}
else
if
(
u
===
'inch'
)
{
len
=
new
Length
(
this
.
value
*
12
,
u
)
if
(
u
nitNode
===
'yard'
)
{
len
=
new
Length
(
this
.
value
/
3
,
u
nitNode
)
}
else
if
(
u
nitNode
===
'inch'
)
{
len
=
new
Length
(
this
.
value
*
12
,
u
nitNode
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment