当前位置:网站首页>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
边栏推荐
- 点击添加按钮--出现一个框框(类似于添加学习经历-本科-研究生)
- Necessity of selenium preloading cookies
- egg中的多进程模型--egg文档搬运工
- Semi synchronous replication of MariaDB
- FileReader API file operation
- After NPM was upgraded, there was a lot of panic
- How to add beautiful code blocks in word | a very complete method to sort out and compare
- Branch and loop statements
- MFC implementation resources are implemented separately by DLL
- CORS and proxy (づ  ̄ 3  ̄) in egg ~ the process of stepping on the pit and filling the pit ~ tot~
猜你喜欢
随机推荐
无线网怎么用手机验证码登录解决方案
Excel 2016 cannot open the file for the first time. Sometimes it is blank and sometimes it is very slow. You have to open it for the second time
Uniapp wechat sharing
Basic knowledge of redis
4 most common automated test challenges and Countermeasures
Excel 2016 打开文件第一次打不开,有时空白,有时很慢要打开第二次才行
Use of ES6 array
低代码和无代码的注意事项
Solve the problem of JS calculation accuracy
数字化转型失败,有哪些原因?
Self incrementing sequence creation of MySQL
2021-11-01
The introduction of lean management needs to achieve these nine points in advance
Project manager's thinking mode worth trying: project success equation
2021-10-12
Implementation of resnet-34 CNN with kears
node中的redis使用--ioredis
C test calls the paddlesharp module to recognize pictures and words
JVM memory and memory overflow exceptions (personal summary)
Three 之 three.js (webgl)模型的删除/场景的清空/内存的释放 的简单整理









