当前位置:网站首页>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
边栏推荐
- My old programmer's perception of the dangers and opportunities of the times?
- Graphics. Fromimage reports an error "graphics object cannot be created from an image that has an indexed pixel..."
- Self incrementing sequence creation of MySQL
- Branch and loop statements
- Laravel implements the Holy Grail model with template inheritance
- selenium預先加載cookie的必要性
- Use of ES6 array
- App Store年交易额100万美元只缴15%佣金,中小开发者心里很矛盾
- 使用 Kears 实现ResNet-34 CNN
- Necessity of selenium preloading cookies
猜你喜欢
SQLyog的基本使用
Laravel routing job
Graphics.FromImage报错“Graphics object cannot be created from an image that has an indexed pixel ...”
Getting started with varnish
Devops life cycle, all you want to know is here!
C test calls the paddlesharp module to recognize pictures and words
Double click The jar package cannot run the solution
工具在数字化转型中扮演了什么样的角色?
Three 之 three.js (webgl)简单实现根据点绘制线/弧线(基于LineGeometry / Line2 / LineMaterial,绘制两点基于圆心的弧线段)
2021-10-12
随机推荐
Five key technologies to improve the devsecops framework
Vscode settings JSON configuration
(十一)vscode代码格式化配置
学习笔记:Unity CustomSRP-13-ColorGrading
CPT 104_ TTL 09
d. TS --- for more detailed knowledge, please refer to the introduction on the official website (chapter of declaration document)
App Store年交易额100万美元只缴15%佣金,中小开发者心里很矛盾
If the route reports an error after deployment according to the framework project
Self incrementing sequence creation of MySQL
即将毕业的大学生找技术开发工作的焦虑根源
C#测试调用PaddleSharp模块识别图片文字
Blender程序化地形制作
The introduction of lean management needs to achieve these nine points in advance
引入精益管理方式,需要提前做到这九点
Study notes: unity customsrp-11-post processing --- bloom
领域驱动模型DDD(三)——使用Saga管理事务
CPT 104_TTL 09
node中的redis使用--ioredis
开源规则引擎——ice:致力于解决灵活繁复的硬编码问题
Click the Add button - a box appears (similar to adding learning experience - undergraduate - Graduate)