当前位置:网站首页>02. Limit the parameter props to a list of types
02. Limit the parameter props to a list of types
2022-07-25 16:11:00 【@Move to the world】
This lesson , Let's see , How to make a props Limited to a specific set of values .
hypothesis , We have a Image Components , The contents are as follows :
<template>
<img
class="image"
:class="computeImgStyle"
src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fnews.yxrb.net%2Fuploadfile%2F2021%2F0419%2F20210419103029168.jpg&refer=http%3A%2F%2Fnews.yxrb.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1661221742&t=07639ae48c1b346e8beaca365ce0b1c1"
/>
</template>
<script setup>
import { ref, computed } from 'vue'
const props = defineProps({
imgStyle: {
type: String,
default: 'square',
},
})
const computeImgStyle = computed(() => {
return {
square: props.imgStyle === 'square',
rounded: props.imgStyle === 'rounded',
}
})
</script>
<style scoped>
.image {边栏推荐
- Dpdk packet receiving and sending problem case: non packet receiving problem location triggered by mismatched packet sending and receiving function
- MySQL table read lock
- Lazy loading of pictures
- 0x80131500打不开微软商店的解决办法
- [Shakespeare: keep the fun of being a man]
- Recommended collection, which is probably the most comprehensive coding method summary of category type features
- 意向锁(Intention Lock)
- MySQL isolation level transactions
- Analysis and solution of data and clock mismatch delay in SPI transmission
- Intention lock
猜你喜欢

Food safety - do you really understand the ubiquitous frozen food?

Circulaindicator component, which makes the indicator style more diversified

狂神redis笔记12

终极套娃 2.0 | 云原生交付的封装

Crazy God redis notes 12

产品动态丨Android 13 高效适配全新升级

面试突击:为什么 TCP 需要 3 次握手?

MQTT X CLI 正式发布:强大易用的 MQTT 5.0 命令行工具

2w字详解数据湖:概念、特征、架构与案例

leetcode:154. 寻找旋转排序数组中的最小值 II【关于旋转排序数组的中后定位二分法】
随机推荐
Boomi荣获“多元化最佳首席执行官奖”和“职业成长最佳公司奖”,在大型公司类别中跻身50强
Save the image with gaussdb (for redis), and the recommended business can easily reduce the cost by 60%
30 lines write the concurrency tool class yourself (semaphore, cyclicbarrier, countdownlatch)
记得那两句话
PageHelper.startPage没有生效问题
Exclusive lock
C# 音乐
Golang review summary
食品安全丨无处不在的冷冻食品,你真的了解吗?
泰山OFFICE技术讲座:英寸,厘米,磅,派卡,提,行,字行,像素的换算关系
Implementation of recommendation system collaborative filtering in spark
一文入门Redis
MySQL tutorial 66 data table query statement
Okaleido上线聚变Mining模式,OKA通证当下产出的唯一方式
【IJCAI 2022】参数高效的大模型稀疏训练方法,大幅减少稀疏训练所需资源
Visual studio 2022 view class diagram
Product dynamics - Android 13 high-efficiency adaptation new upgrade
Product upgrade observation station in June
递归菜单查询(递归:自己查自己)
Leetcode:154. find the minimum value II in the rotation sort array [about the middle and rear positioning dichotomy of the rotation sort array]