1.应用介绍
1.1应用开发目录介绍
1.2使用规则
2.初入注意事项
(1)在进行预览时,要先选择预览所对应的hml等文件下才能进行预览;
(2)在config.json里要配置所对应的页的文件路径;
(3)配置路径以后单纯刷新是不能显示新配置的页面的,要重新进入预览;
(4)创建项目名称,注意首字母大写;
(5)引用代码文件,需使用相对路径,比如: ../common/utils.js
(6)引用资源文件,推荐使用绝对路径。比如:/common/xxx.png.
(7)建议使用绝对路径进行文件路径编码.
(8)数据文件 import 导入只能使用相对路径,不能使用绝对路径,使用绝对路径会报错。
3.tolist应用构建
3.1函数
3.1.1
remove(删除)函数的使用
οnclick=”remove($idx)”;
idx为当前事件的的索引;
remove(index){
this.todolist.splice (index,1)
}
3.1.2
change函数的使用
οnchange=”switchchange($idx)”;
idx为当前事件的索引;
switchchange(index){
this.todolist[index].status.
}
3.1.3
computed(计算)属性的使用
computed : {
todocount()i
let num=e
this.todolist.forEach(element -> {
if( !element.status){
num++
}
});
return num
}
}
3.1.4
addtodo(添加)函数的使用
addtodo( ){
this.todolist.push({
info:"这是添加的事项",
status : false
})
}
4.学习资源
4.1.鸿蒙官方文档
4.2.菜鸟JS文档
JavaScript 教程 | 菜鸟教程https://www.runoob.com/js/js-tutorial.html