当前位置:网站首页>Merkel Studio - harmonyos implementation list to do
Merkel Studio - harmonyos implementation list to do
2022-07-29 01:38:00 【Sunny is not sunny】
HarmonyOS Implement the list to do
One 、 Data profile
In the picture datas Put under the path todolist.js The configuration file

Two 、HML file
stay HML In file , Use for Label from todoList Read data circularly in data
The main use of switch Component implementation to do

<switch showtext="true" checked="{
{$item.status}}" texton=" complete " textoff=" To do " class="switch" @change="switchChange($idx)"></switch>
Delete button
[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-m3OxcC2D-1658935411024)(…/…/…/AppData/Roaming/Typora/typora-user-images/image-20220727230742413.png)]
<button class="remove" @click="remove($idx)"> Delete </button>
Complete code :
<div class="container">
<text class="title"> Clock in today </text>
<div class="item" for="{
{todoList}}">
<text class="todo">{
{$item.info}}</text>
<switch showtext="true" checked="{
{$item.status}}" texton=" complete " textoff=" To do " class="switch" @change="switchChange($idx)"></switch>
<button class="remove" @click="remove($idx)"> Delete </button>
</div>
<div class="info">
<text class="info-text"> You have </text>
<text class="info-num">{
{todoCount}}</text>
<text class="info-text"> Things to do , come on. !</text>
</div>
<div class="add-todo">
<input class="plan-input" type="text"></input>
<button class="plan-btn" onclick="addTodo" @click="addTodo"> Add to do </button>
</div>
</div>
3、 ... and 、JS file
Be careful : Need from datas Import data profile in
And because the preview function does not support monitoring keyboard input , Just write the data to be added dead
import todoList from "../../common/datas/todoList.js"
export default {
data: {
todoList
},
remove(index){
console.log(index)
this.todoList.splice(index,1)
},
addTodo(){
this.todoList.push({
info: 'IDE The tool cannot listen for keyboard input ',
status: false
})
},
computed:{
todoCount(){
let num=0;
this.todoList.forEach(element => {
if(!element.status){
num++
}
});
return num
}
}
}
Four 、 Realization

边栏推荐
- numpy. Where() usage and np.argsort() usage
- Oozie job scheduling
- 了解网址url的组成后 运用url模块、querystring模块和mime模块完善静态网站
- DVWA之SQL注入
- Embedded sharing collection 23
- C语言300行代码实现扫雷(可展开+可标记+可更改困难级别)
- 易观分析:以用户为中心,提升手机银行用户体验,助力用户价值增长
- 什么是原码、反码和补码
- 2022年最火的十大测试工具,你掌握了几个
- SQL question brushing: find the current salary details and department number Dept_ no
猜你喜欢

TypeError: can only concatenate str (not “int“) to str

Introduction to Elmo, Bert and GPT

body中基本标签

明日无限计划,2022某公司元宇宙产品发布会活动概念策划方案

ELMO,BERT和GPT简介

SQL question brushing: find the last of all employees who have been assigned departments_ Name and first_ Name and Dept_ no

HCIA配置实例(eNSP)

Docker compose install MySQL

Analysis of Multi Chain use cases on moonbeam -- review of Derek's speech in Polkadot decoded 2022

SQL injection of DVWA
随机推荐
Introduction to Elmo, Bert and GPT
Openpyxl merge cells
C语言犄角旮旯的知识之形参、实参、main函数参数、数组或指针做函数参数等
HCIA配置实例(eNSP)
了解各种路径
DocuWare 移动劳动力解决方案可帮助您构建新的生产力模式:随时随地、任何设备
Matplotlib Chinese question
SQL question brushing: find the last of all employees_ Name and first_ Name and corresponding department number Dept_ no
Docker-compose安装mysql
围绕新市民金融聚焦差异化产品设计、智能技术提效及素养教育
Bracket matching test
Log4j dynamic loading configuration file
[idea] where to use the query field
Groundwater, soil, geology and environment
API stability guarantee of Prometheus
Recommended Spanish translation of Beijing passport
明日无限计划,2022某公司元宇宙产品发布会活动概念策划方案
Test / development programmers rely on technology to survive the midlife crisis? Improve your own value
Moonbeam上的多链用例解析——Derek在Polkadot Decoded 2022的演讲文字回顾
Ruiji takeout project actual battle day01