当前位置:网站首页>01. A simpler way to deliver a large number of props
01. A simpler way to deliver a large number of props
2022-07-25 16:11:00 【@Move to the world】
today , Let's learn about Vue Skills booklet , This is the first lesson , That is, the title shows : Deliver a lot of... In a simpler way props, The example is vue3 To demonstrate , Of course. vue2 Also applicable in .
Let's get straight to the point , Suppose we have a component that displays user information , As shown below :
<template>
<div>
<p> full name :{
{ name }}</p>
<p> occupation :{
{ job }}</p>
<p> Age :{
{ age }}</p>
</div>
</template>
<script setup>
import { ref } from 'vue'
defineProps({
name: String,
job: String,
age: Number,
})
const count = ref(0)
</script>
This component receives three parameters , Namely User name 、 Work 、 And age . stay template The corresponding three field values are displayed in .
then , In parent component , introduce User Components , Make a statement userInfo object , And then to User The component passes in these three parameters , As shown below :
<template>
<User :name="userInfo.name" :job="userInfo.job" :age="userInfo.age" />
</template>
<script setup>
import { reactive } from 'vu边栏推荐
- Dpdk packet receiving and sending problem case: non packet receiving problem location triggered by mismatched packet sending and receiving function
- 【IJCAI 2022】参数高效的大模型稀疏训练方法,大幅减少稀疏训练所需资源
- Record Locks(记录锁)
- leetcode:528. 按权重随机选择【普通随机失效 + 要用前缀和二分】
- MySQL isolation level transactions
- Typescript learning 1 - data types
- Win11动态磁贴没了?Win11中恢复动态磁贴的方法
- Win11自带画图软件怎么显示标尺?
- Product upgrade observation station in June
- MySQL教程71-WHERE 条件查询数据
猜你喜欢

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

解决Win10磁盘占用100%

General test case writing specification

Ice 100g network card fragment message hash problem
![Leetcode:154. find the minimum value II in the rotation sort array [about the middle and rear positioning dichotomy of the rotation sort array]](/img/03/54a2d82a17cd07374dc0aedacd7b11.png)
Leetcode:154. find the minimum value II in the rotation sort array [about the middle and rear positioning dichotomy of the rotation sort array]

TypeError: Unrecognized value type: <class ‘str‘> ParserError: Unknown string format

Wavelet transform --dwt2 and wavedec2

Win11自带画图软件怎么显示标尺?

EMQX Cloud 更新:日志分析增加更多参数,监控运维更省心

JWT diagram
随机推荐
Crazy God redis notes 12
[IJCAI 2022] parameter efficient large model sparse training method, which greatly reduces the resources required for sparse training
行云管家V6.5.1/2/3系列版本发布:数据库OpenAPI能力持续强化
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]
开发者如何为React Native选择合适的数据库
Analysis and solution of data and clock mismatch delay in SPI transmission
30 lines write the concurrency tool class yourself (semaphore, cyclicbarrier, countdownlatch)
MySQL intent lock
MySQL table write lock
The annualized interest rate of treasury bonds is too low. Is there a financial product with a higher annualized interest rate than the reverse repurchase of treasury bonds?
C# 模拟抽奖
MySQL explicit lock
基于Caffe ResNet-50网络实现图片分类(仅推理)的实验复现
MySQL implicit lock
mysql 表读锁
Which led display manufacturer is better
今天睡眠质量记录84分
Win11动态磁贴没了?Win11中恢复动态磁贴的方法
一文理解分布式开发中的服务治理
How matlab saves all the data after running