-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a5a3632
commit 54fd723
Showing
27 changed files
with
972 additions
and
59 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
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
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
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
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,63 @@ | ||
import { defineComponent } from 'vue' | ||
import Icon from '@/components-global/icon/main' | ||
import './style.less' | ||
|
||
export default defineComponent({ | ||
name: 'XCell', | ||
props: { | ||
icon: { | ||
type: String, | ||
default: '' | ||
}, | ||
onClick: { | ||
type: Function, | ||
default: () => { | ||
/* */ | ||
} | ||
}, | ||
title: { | ||
type: String, | ||
default: '' | ||
}, | ||
externalLink: { | ||
type: String, | ||
default: '' | ||
}, | ||
needArrow: { | ||
type: Boolean, | ||
default: true | ||
} | ||
}, | ||
setup($props) { | ||
console.log('X-Cell => Go~') | ||
|
||
const onClick = (e: any) => { | ||
if ($props.externalLink) { | ||
window.open($props.externalLink) | ||
} else { | ||
$props.onClick(e) | ||
} | ||
} | ||
|
||
return function(this: any) { | ||
return ( | ||
<div class="x-cell" onClick={onClick}> | ||
<div class="x-cell__left"> | ||
{!!this.icon && ( | ||
<Icon icon={this.icon} color="#4c4c4c" size={22}></Icon> | ||
)} | ||
{this.title} | ||
</div> | ||
<div class="x-cell__right"> | ||
{this.$slots.default?.()} | ||
{this.needArrow && ( | ||
<div class="x-cell__rightarrow"> | ||
<Icon icon="toRight" color="#afafaf" size={16}></Icon> | ||
</div> | ||
)} | ||
</div> | ||
</div> | ||
) | ||
} | ||
} | ||
}) |
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
Oops, something went wrong.