当前位置:网站首页>Various situations of data / component binding
Various situations of data / component binding
2022-04-23 05:25:00 【Courtesy.】

<template>
<div class="wrapper">
<!-- Data binding -->
<text class="title"> Data binding :{
{
title }}</text>
<!-- Event binding -->
<text @click="press" class="bt"> Event binding :{
{
click }}</text>
<!-- The list of rendering -->
<div>
<!-- tid="uniqueId" Indicates the use of an array list Array elements of $item.uniqueId As the only element of the array Id, And must guarantee uniqueId The value of this attribute is different in each array element . -->
<div for="{
{list}}" tid="uniqueId">
<!-- <text>{
{
$idx}}</text> -->
<text> The list of rendering {
{
$item.uniqueId }}</text>
</div>
</div>
<!-- Conditions apply colours to a drawing if-->
<div>
<text if="{
{display}}">Hello-1</text>
<text elif="{
{display}}">Hello-2</text>
<text else> Conditions apply colours to a drawing if else</text>
</div>
<!-- Conditions apply colours to a drawing show-->
<text show="{
{visible}}"> Conditions apply colours to a drawing show</text>
<!-- Logic control block -->
<div>
<list class="ljk">
<text> Logic block control :</text>
<block for="cities">
<list-item type="city">
<text style="color:#faf8fc">{
{
$item.name }}</text>
</list-item>
<list-item type="spot" for="$item.spots">
<text>{
{
$item.address }}</text>
</list-item>
</block>
</list>
</div>
<!-- Introduce custom components -->
<div>
</div>
<!-- Dynamic components -->
<div>
</div>
<!-- Filter components -->
<div>
<text>{
{
message | capitalize('11','22','33') }}</text>
</div>
</div>
</template>
<script>
export default {
data: {
title: " Welcome to experience fast application ",
click:'123456',
list: [
{
uniqueId: 1
},
{
uniqueId: 2
},
{
uniqueId: 3
},
{
uniqueId: 4
}
],
display: false,
visible: true,
cities: [
{
name: ' Beijing ',
spots: [
{
address: ' Chaoyang District of Beijing City '
}
]
},
{
name: ' Shanghai ',
spots: [
{
address: ' Shanghai Disneyland '
},
{
address: ' Shanghai Museum '
},
{
address: ' Shanghai Glass Art Museum '
},
{
address: ' Nanjing Road Pedestrian Street '
}
]
}
],
message: ' Filter components ',
},
capitalize(value) {
if (!value) return ''
value = value.toString()
return value.charAt(0).toUpperCase() + value.slice(1)
},
props: [],
onInit() {
},
press(e) {
this.click = 'Hello'
}
}
</script>
<style>
.wrapper {
flex-direction: column;
}
.bt{
width: 100px;
height: 100px;
color: #0000ff;
}
.ljk{
background-color: #cccccc;
height: 160px;
}
</style>
版权声明
本文为[Courtesy.]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220544339326.html
边栏推荐
- What role do tools play in digital transformation?
- Multi process model in egg -- egg document Porter
- Laravel routing job
- 学习笔记:Unity CustomSRP-11-Post Processing---Bloom
- Domain driven model DDD (III) -- using saga to manage transactions
- What are the most popular recruitment technical skills in 2022? You can't think of it
- JVM memory and memory overflow exceptions (personal summary)
- When is it appropriate for automated testing? (bottom)
- C#测试调用PaddleSharp模块识别图片文字
- Master-slave replication of MariaDB database
猜你喜欢

My old programmer's perception of the dangers and opportunities of the times?

Use of uniapp native plug-ins

Modèle axé sur le domaine DDD (III) - gestion des transactions à l'aide de Saga

Qingdao agile tour, coming!
Basic knowledge of redis

双击.jar包无法运行解决方法

selenium預先加載cookie的必要性

我这位老程序员对时代危险和机遇的一点感悟?

Devops life cycle, all you want to know is here!

Uncle wolf is looking for a translator -- Plato -- ongoing translation
随机推荐
【openh264】cmake: msopenh264-static
C#测试调用PaddleSharp模块识别图片文字
Solve the problem of JS calculation accuracy
CPT 104_TTL 09
What are the most popular recruitment technical skills in 2022? You can't think of it
My old programmer's perception of the dangers and opportunities of the times?
What role do tools play in digital transformation?
Excel 2016 打开文件第一次打不开,有时空白,有时很慢要打开第二次才行
4 most common automated test challenges and Countermeasures
我这位老程序员对时代危险和机遇的一点感悟?
Anti crawler (0): are you still climbing naked with selenium? You're being watched! Crack webdriver anti crawler
Solution of how to log in with mobile phone verification code in wireless network
MFC实现资源单独Dll实现
Devops life cycle, all you want to know is here!
d.ts---更详细的知识还是需要看官网的介绍(声明文件章节)
CPT 104_ TTL 09
npm升级后问题,慌得一批
Laravel routing job
Study notes: unity customsrp-13-colorgrading
青岛敏捷之旅,来了!