Former-commit-id: 5d75986f02de2f4515121e9f797b835dba132732 [formerly 5d75986f02de2f4515121e9f797b835dba132732 [formerly 5d75986f02de2f4515121e9f797b835dba132732 [formerly 5d75986f02de2f4515121e9f797b835dba132732 [formerly 8c4098bcffd50089b041edcf9d539c64c3c92b16 [formerly 1bf5ee08c5424c0a4cedac421d52cf8c8393ae7f]]]]]
Former-commit-id: 3aa6fad9f9c31f62376dfb27f62fa937d0735e55
Former-commit-id: d293c0b275dc8c4d439fa04a45d9d4efa1dd8f4c
Former-commit-id: a737d8ff3f0c9d829e66a1cd305257961c551eda [formerly 4d2360f8b865bfab066291680106dc95df97ce2a]
Former-commit-id: b64f59d9203d16e71bcd21065aba7ead88566938
Former-commit-id: 4350c691cdff708266be623edf8f1b9d61faeb02
Former-commit-id: 1dba1637790b1f2c87733adfdfcc8491a97bfd1d
Former-commit-id: e17d989004ecb5fb7ce620103b997998da42b8d9
Former-commit-id: 3b781b9b28f6ed584b9c6dbfa5fafe3f8c1475b5
This commit is contained in:
liyang
2018-07-17 21:54:38 +08:00
parent db62c21964
commit 14c921e6b1
214 changed files with 157 additions and 139 deletions

View File

@@ -1,77 +0,0 @@
<template>
<div>
<el-popover
ref="pop"
placement="right"
:title="icon"
width="300"
trigger="click">
<div class="icon-group">
<i :class="'fa fa-' + icon"></i>
</div>
<el-row :gutter="10">
<el-col :span="8">
<el-tooltip effect="dark" :content="iconClass" placement="top">
<el-button @click="copy(iconClass)" style="width: 100%;">Class</el-button>
</el-tooltip>
</el-col>
<el-col :span="8">
<el-tooltip effect="dark" :content="iconHtml" placement="top">
<el-button @click="copy(iconHtml)" style="width: 100%;">HTML</el-button>
</el-tooltip>
</el-col>
<el-col :span="8">
<el-tooltip effect="dark" :content="iconComponent" placement="top">
<el-button @click="copy(iconComponent)" style="width: 100%;">组件</el-button>
</el-tooltip>
</el-col>
</el-row>
</el-popover>
<span v-popover:pop>
<el-tag type="info">
<i :class="'fa fa-' + icon"></i>
</el-tag>
<span style="font-size: 10px; margin-left: 5px;">{{icon}}</span>
</span>
</div>
</template>
<script>
import clipboard from 'clipboard-polyfill'
export default {
props: {
icon: {
type: String,
required: false,
default: ''
}
},
computed: {
iconClass () {
return `fa fa-${this.icon}`
},
iconHtml () {
return `<i class="fa fa-${this.icon}" aria-hidden="true"></i>`
},
iconComponent () {
return `<d2-icon name="${this.icon}"/>`
}
},
methods: {
copy (text) {
clipboard.writeText(text)
this.$message({
message: `${text} 复制到剪贴板`,
type: 'success'
})
}
}
}
</script>
<style lang="scss" scoped>
.icon-group {
text-align: center;
font-size: 200px;
}
</style>

View File

@@ -1 +0,0 @@
822e9d488a148a997d7098a0608f482ab9f9fb7a

View File

@@ -1,23 +0,0 @@
<template>
<d2-container>
<template slot="header">图标组件</template>
<d2-icon class="d2-mr-10"/>
<d2-icon name="github" class="d2-mr-10"/>
<d2-icon name="github" style="font-size: 100px;" class="d2-mr-10"/>
<d2-icon name="github" class="icon-demo"/>
</d2-container>
</template>
<style lang="scss" scoped>
@import '~@/assets/style/public.scss';
.icon-demo {
transition: all .3s;
font-size: 100px;
color: #409EFF;
@extend %unable-select;
&:hover{
color: #F56C6C;
transform: scale(1.2) rotate(30deg);
}
}
</style>

View File

@@ -1,46 +0,0 @@
<template>
<d2-container type="full" scroll>
<template slot="header">
<el-radio-group v-model="showIndex" size="mini">
<el-radio-button
v-for="(item, index) in radioOptions"
:key="index"
:label="item.value">
{{item.label}}
</el-radio-button>
</el-radio-group>
</template>
<el-row style="margin: -10px;">
<el-alert title="点击图标复制代码" type="info" class="d2-m-10" style="width: auto;"/>
<el-col v-for="(iconItem, iconIndex) in iconShow.icon" :key="iconIndex" :span="6" class="d2-p-10">
<d2-icon-cell :icon="iconItem"/>
</el-col>
</el-row>
</d2-container>
</template>
<script>
import icon from './data/index'
export default {
components: {
'd2-icon-cell': () => import('./components/d2-icon-cell')
},
data () {
return {
icon,
showIndex: 12
}
},
computed: {
iconShow () {
return this.icon[this.showIndex]
},
radioOptions () {
return this.icon.map((e, index) => ({
label: e.title,
value: index
}))
}
}
}
</script>

View File

@@ -1,57 +0,0 @@
<template>
<d2-container>
<template slot="header">图标选择器</template>
<div class="title-group">
<p class="title">一般用法</p>
<p class="sub-title">
<template v-if="icon">
选择的图标 {{icon}}
<i :class="'fa fa-' + icon"></i>
</template>
<template v-else>未选择</template>
</p>
</div>
<d2-icon-select v-model="icon"/>
<div class="title-group">
<p class="title">用户可以输入</p>
<p class="sub-title">
<template v-if="icon2">
选择的图标 {{icon2}}
<i :class="'fa fa-' + icon2"></i>
</template>
<template v-else>未选择</template>
</p>
</div>
<d2-icon-select v-model="icon2" :user-input="true"/>
</d2-container>
</template>
<script>
export default {
data () {
return {
icon: '',
icon2: ''
}
}
}
</script>
<style lang="scss" scoped>
@import '~@/assets/style/public.scss';
.title-group {
margin-top: 20px;
margin-bottom: 10px;
&:first-child {
margin-top: 0px;
}
.title {
margin: 0px;
}
.sub-title {
margin: 0px;
color: $color-text-sub;
font-size: 10px;
}
}
</style>

View File

@@ -1,43 +0,0 @@
<template>
<d2-container>
<template slot="header">SVG图标组件</template>
<el-row>
<el-col class="icon-card" :span="4" v-for="(icon, index) in $IconSvg" :key="index">
<d2-icon-svg class="icon" :name="icon"/>
<div class="icon-title">
<span>{{icon}}</span>
</div>
</el-col>
</el-row>
</d2-container>
</template>
<style lang="scss" scoped>
@import '~@/assets/style/public.scss';
.icon-card {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 150px;
&:hover {
.icon {
transform: scale(1.1);
}
.icon-title {
color: $color-text-main;
}
}
}
.icon {
height: 80px;
width: 80px;
transition: all .3s;
cursor: pointer;
}
.icon-title {
font-size: 12px;
margin-top: 10px;
color: $color-text-normal;
}
</style>