style-优化iconify组件

This commit is contained in:
h_mo 2022-11-28 22:40:59 +08:00
parent 6f8f60a9f9
commit 79c956093b
2 changed files with 10 additions and 10 deletions

View File

@ -7,23 +7,21 @@
type: String,
},
size: {
type: Number,
type: [Number, String],
},
color: {
type: String,
},
});
const iconName = computed(() => {
return `i-${props.icon}`;
});
const iconSize = ref<string | boolean>(
props.size ? `${props.size}rpx` : false,
);
const style = computed(() => {
return assign(
unref(iconSize) ? { size: props.size } : {},
unref(iconSize)
? { width: unref(iconSize), height: unref(iconSize) }
: {},
props.color ? { color: props.color } : {},
);
});

View File

@ -29,13 +29,15 @@
<text class="">是否是Vue3: {{ isVue3 }}</text>
</view>
<view class="text-area">
<text class="">当前平台: {{ platform }}</text>
<text class="un-text-red">当前平台: {{ platform }}</text>
</view>
<BasicButton @click="handleGetStarted">Get Started </BasicButton>
<view class="un-text-red">uno css</view>
<Iconify icon="i-ph-anchor-simple-thin" />
<Iconify icon="i-ph-airplane-thin" />
<Iconify icon="i-ant-design-check-circle-filled" />
<Iconify icon="i-ph-anchor-simple-thin" size="65" />
<Iconify icon="i-system-uicons-book-text" />
<Iconify icon="i-system-uicons-battery-full" size="65" />
<Iconify icon="i-system-uicons-box-add" :size="65" />
<Iconify icon="i-system-uicons-bell-snooze" color="red" :size="65" />
</view>
</AppProvider>
</template>