123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- <template>
- <!-- #ifdef APP -->
- <scroll-view style="flex: 1;">
- <!-- #endif -->
- <view style="align-items: center;align-self: center;">
- <view class="iconContainer">
- <view class="iconItem" v-for="item in uniIcons">
- <text class="icon" :style="{'font-weight': fontWeight, 'font-style': fontStyle}">{{String.fromCharCode(parseInt(item.code,16))}}</text>
- <text class="code">\u{{item.code}}</text>
- <text class="name">{{item.name}}</text>
- </view>
- </view>
- </view>
- <!-- #ifdef APP -->
- </scroll-view>
- <!-- #endif -->
- </template>
- <script lang="uts">
- type Icon = {
- name : string,
- code : string,
- }
- export default {
- data() {
- return {
- uniIcons: [ //图标数据
- {
- 'name':'back',
- 'code':'E601',
- },
- {
- 'name':'forward',
- 'code':'E600',
- },
- {
- 'name':'share',
- 'code':'E602',
- },
- {
- 'name':'favorites',
- 'code':'E604',
- },
- {
- 'name':'home',
- 'code':'E605',
- },
- {
- 'name':'more',
- 'code':'E606',
- },
- {
- 'name':'close',
- 'code':'E650',
- },
- {
- 'name':'down',
- 'code':'E661',
- },
- {
- 'name':'circle',
- 'code':'EA01',
- },
- {
- 'name':'warn',
- 'code':'EA0F',
- },
- {
- 'name':'info',
- 'code':'EA03',
- },
- {
- 'name':'info circle',
- 'code':'EA04',
- },
- {
- 'name':'success',
- 'code':'EA06',
- },
- {
- 'name':'success circle',
- 'code':'EA07',
- },
- {
- 'name':'success no circle',
- 'code':'EA08',
- },
- {
- 'name':'cancel circle',
- 'code':'EA0B',
- },
- {
- 'name':'clear',
- 'code':'EA14',
- },
- {
- 'name':'download',
- 'code':'EA19',
- },
- {
- 'name':'waitnig',
- 'code':'EA1E',
- },
- {
- 'name':'search',
- 'code':'EA23',
- }
- ] as Icon[],
- // 自动化测试
- fontWeight: 'normal',
- fontStyle: 'normal'
- }
- },
- methods: {
- // 自动化测试
- changeStyle() {
- this.fontWeight = 'bold';
- this.fontStyle = 'italic';
- }
- }
- }
- </script>
- <style>
- .iconContainer {
- flex-direction: row;
- flex-wrap: wrap;
- justify-content: center;
- }
- .iconItem {
- width: 100px;
- height: 150px;
- justify-content: center;
- align-items: center;
- }
- .icon {
- width: 48px;
- height: 48px;
- font-family: uni-icon;
- font-size: 42px;
- line-height: 48px;
- color: #333;
- margin-bottom: 8px;
- }
- .code {
- font-size: 14px;
- color: #f00;
- }
- .name {
- font-size: 12px;
- color: #000;
- }
- </style>
|