当前位置:网站首页>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 {边栏推荐
- Experimental reproduction of image classification (reasoning only) based on caffe resnet-50 network
- 国债年化利率太低了,有比国债逆回购年化利率还要高的理财产品吗?
- How Google cloud disk is associated with Google colab
- Recommended collection, which is probably the most comprehensive coding method summary of category type features
- I interviewed 8 companies and got 5 offers in a week. Share my experience
- Record locks
- MATLAB optimization tool manopt installation
- Shared lock
- Matlab -- CVX optimization kit installation
- 使用 Terraform 在 AWS 上快速部署 MQTT 集群
猜你喜欢

【IJCAI 2022】参数高效的大模型稀疏训练方法,大幅减少稀疏训练所需资源

General test case writing specification

如何构建面向海量数据、高实时要求的企业级OLAP数据引擎?

Waterfall flow layout

【图像去噪】基于双立方插值和稀疏表示实现图像去噪matlab源码
![Leetcode:6127. Number of high-quality number pairs [bit operation finding rules + the sum of two numbers is greater than or equal to K + dichotomy]](/img/b5/5c7fc70b8025cf7ef21d645a3ac22e.png)
Leetcode:6127. Number of high-quality number pairs [bit operation finding rules + the sum of two numbers is greater than or equal to K + dichotomy]

推荐系统-协同过滤在Spark中的实现

Circulaindicator component, which makes the indicator style more diversified

【服务器数据恢复】HP EVA服务器存储意外断电导致RAID信息丢失的数据恢复案例

一文入门Redis
随机推荐
权限管理-角色分配菜单
Win11自带画图软件怎么显示标尺?
MySQL全局锁
电阻电路的等效变化(Ⅱ)
【服务器数据恢复】HP EVA服务器存储意外断电导致RAID信息丢失的数据恢复案例
MySQL教程68-AS 设置别名
Gap locks
一文入门Redis
Release of v6.5.1/2/3 series of versions of Xingyun housekeeper: the ability of database OpenAPI continues to be strengthened
R语言ggplot2可视化线图(line)、自定义配置标题文本相关内容颜色和图例(legend)颜色相匹配(和分组线图的颜色相匹配、match colors of groups)
General test case writing specification
Ml image depth learning and convolution neural network
MySQL tutorial 68-as setting alias
Wavelet transform --dwt2 and wavedec2
TypeError: Unrecognized value type: <class ‘str‘> ParserError: Unknown string format
[wechat applet] detailed explanation of applet host environment
Data system partition design - Request Routing
Product upgrade observation station in June
Record locks
MQTT X CLI 正式发布:强大易用的 MQTT 5.0 命令行工具