-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
230 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from "react"; | ||
import { Label } from "@lugia/lugia-web"; | ||
|
||
export default class BasicLabel extends React.Component<any, any> { | ||
|
||
render() { | ||
return <React.Fragment> | ||
<Label onClick={this.onClick}>这是一个文本组件</Label> | ||
</React.Fragment>; | ||
} | ||
onClick = () => { | ||
console.log('clickLabel'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from "react"; | ||
import { Label } from "@lugia/lugia-web"; | ||
|
||
export default class PrefixLabel extends React.Component<any, any> { | ||
render() { | ||
return <React.Fragment> | ||
<Label showPrefix prefix={'*'} >这是一个带前缀的文本组件</Label> | ||
<br/><br/> | ||
<Label showPrefix prefix={'##'} >这是一个带前缀的文本组件</Label> | ||
</React.Fragment>; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import React from "react"; | ||
import { Label ,Theme} from "@lugia/lugia-web"; | ||
import Widget from "@lugia/lugia-web/dist/consts"; | ||
|
||
export default class PrefixLabel extends React.Component<any, any> { | ||
render() { | ||
const config = { | ||
[Widget.Label]: { | ||
Container: { | ||
normal: { | ||
color: '#2d3c93', | ||
font: { | ||
weight: 'bold', | ||
size: 20, | ||
}, | ||
margin: { | ||
left: 30, | ||
top: 10, | ||
}, | ||
padding: { | ||
right: 10, | ||
bottom: 10, | ||
}, | ||
border: { | ||
left:{ | ||
width:2, | ||
style:'solid', | ||
color:'#4d63ff' | ||
} | ||
}, | ||
|
||
}, | ||
hover: { | ||
color: '#ac3400', | ||
cursor: 'pointer', | ||
}, | ||
}, | ||
LabelPrefix: { | ||
normal: { | ||
color: 'red', | ||
margin: { | ||
right: 10, | ||
left: 5 | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; | ||
return <Theme config={config}> | ||
<Label showPrefix prefix={'*'} >这是一个带前缀的文本组件</Label> | ||
|
||
</Theme>; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from "react"; | ||
import { Label } from "@lugia/lugia-web"; | ||
|
||
|
||
export default class TextLabel extends React.Component<any, any> { | ||
|
||
render() { | ||
return <React.Fragment> | ||
<Label text={'这是一个传入text属性的文本组件'}/> | ||
</React.Fragment>; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module.exports = { | ||
BasicLabel: { | ||
title: "基础使用", | ||
desc: "基础Label的用法" | ||
}, | ||
TextLabel: { | ||
title: "传入text属性", | ||
desc: "传入text属性的用法" | ||
}, | ||
PrefixLabel: { | ||
title: "有前缀的文本组件", | ||
desc: "有前缀的文本组件的用法" | ||
}, | ||
StyleLabel: { | ||
title: "文本组件主题配置", | ||
desc: "可支持配置的文本组件样式" | ||
} | ||
}; |
Oops, something went wrong.