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
Hide 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
{
export
class
Length
{
value
value
unit
unit
unitEnum
=
[
'foot'
,
'yard'
,
'inch'
]
//
unitEnum = ['foot', 'yard', 'inch']
constructor
(
val
,
uint
)
{
constructor
(
val
,
uint
)
{
this
.
value
=
val
this
.
value
=
val
...
@@ -15,29 +15,29 @@ export class Length {
...
@@ -15,29 +15,29 @@ export class Length {
getUint
()
{
getUint
()
{
return
this
.
unit
return
this
.
unit
}
}
parseTo
(
u
)
{
parseTo
(
u
nitNode
)
{
let
len
=
this
let
len
=
this
if
(
this
.
unit
===
'yard'
)
{
if
(
this
.
unit
===
'yard'
)
{
if
(
u
===
'f'
)
{
if
(
u
nitNode
===
'f'
)
{
len
=
new
Length
(
this
.
value
*
3
,
u
)
len
=
new
Length
(
this
.
value
*
3
,
u
nitNode
)
}
else
if
(
u
===
'inch'
)
{
}
else
if
(
u
nitNode
===
'inch'
)
{
len
=
new
Length
(
this
.
value
*
36
,
u
)
len
=
new
Length
(
this
.
value
*
36
,
u
nitNode
)
}
}
}
}
if
(
this
.
unit
===
'inch'
)
{
if
(
this
.
unit
===
'inch'
)
{
if
(
u
===
'yard'
)
{
if
(
u
nitNode
===
'yard'
)
{
len
=
new
Length
(
this
.
value
/
36
,
u
)
len
=
new
Length
(
this
.
value
/
36
,
u
nitNode
)
}
else
if
(
u
===
'f'
)
{
}
else
if
(
u
nitNode
===
'f'
)
{
len
=
new
Length
(
this
.
value
/
12
,
u
)
len
=
new
Length
(
this
.
value
/
12
,
u
nitNode
)
}
}
}
}
if
(
this
.
unit
===
'f'
)
{
if
(
this
.
unit
===
'f'
)
{
if
(
u
===
'yard'
)
{
if
(
u
nitNode
===
'yard'
)
{
len
=
new
Length
(
this
.
value
/
3
,
u
)
len
=
new
Length
(
this
.
value
/
3
,
u
nitNode
)
}
else
if
(
u
===
'inch'
)
{
}
else
if
(
u
nitNode
===
'inch'
)
{
len
=
new
Length
(
this
.
value
*
12
,
u
)
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