当前位置:网站首页>uni-app进阶之创建组件/原生渲染【day9】
uni-app进阶之创建组件/原生渲染【day9】
2022-06-21 09:28:00 【华为云】
为了提高开发效率,hbuilderx将常见的uni app代码封装到以u开头的代码块中。如果在模板标记中输入ulist,将自动生成以下代码:
<view class="uni-list"> <view class="uni-list-cell"> <view class="uni-list-cell-navigate uni-navigate-right" v-for="(item,index) in list" :key="index"> {{item.value}} </view> </view></view>几乎所有组件,无论是内置的还是uni-UI,都已封装为代码块。在hbuilderx的Vue代码模板区域中单击u,代码助手将提示所有可见的列表。您还可以查看hbuilderx菜单工具-代码块设置-vue代码块左侧列表中的所有代码。
使用 Chrome 调试 H5
设置定时器:
//选择适合需求的定时器this.timer = setTimeout( () => { // 这里添加您的逻辑 }, 1000)this.timer = setInterval( () => { // 同上 }, 1000)进入uni app项目,单击工具栏中的Run->Run to browser->select chrome将uni app运行到浏览器。您可以参考运行uni应用程序。在浏览器上运行uni应用程序后,您可以像普通web项目一样进行预览和调试。
单击chrome控制台的sources列以调试JS断点。
在页面下的网页包中找到项目目录,直接找到对应的Vue页面进行断点调试;或按ctrl+p搜索文件名,进入调试页面;您也可以单击控制台上的日志信息,进入相应的页面进行调试。

原生渲染的视图层
在app nvue中,折扣也存在。react native中也存在此问题。Weex发明了bindingx机制,它可以在JS中将表达式传递给本机,然后在本机解析后根据指令操作视图层。这项技术也可以在uni app中使用。
作为一个表达式,bindingx不如JS强大,但可以实现基本的手势监控和动画。例如,当uni UI的swiperaction组件在app nvue下运行时,bindingx将自动启用以实现平滑跟踪。
对于复杂页面,更新某个区域的数据时,需要将该区域制作成一个组件,因此更新数据时只更新该组件,否则会更新整个页面的数据,导致点击延迟。这是自定义组件编译模式的特点。产生差异的原因是小程序当前仅提供组件差异更新机制,无法自动计算所有页面差异。
代码块分为标记代码块和JS代码块。如果在脚本标记中输入ushowtoast-enter,将自动生成以下代码:
uni.showToast({ title: '', mask: false duration: 1500});onUnload如下:
onUnload() { if(this.timer) { clearTimeout(this.timer); this.timer = null; } }边栏推荐
- 【实战】STM32MP157开发教程之FreeRTOS系统篇6:FreeRTOS 列表和列表项
- How do I listen for changes in DOM element size?
- Use this for attributes in mapstate
- The R language uses the sink function to export the string to the txt file in the specified directory. If no directory is specified, it will be output to the current working dir
- Request and response must know
- How to use ADB shell to query process traffic
- 【实战】STM32 FreeRTOS移植系列教程5:FreeRTOS消息队列
- R language ggplot2 visualization, draw two lines in the same ggplot2 graph in a graph, and use postscript function to save the visualization image to PS format file in the specified directory
- Pingcap was selected as the "voice of customers" of Gartner cloud database in 2022, and won the highest score of "outstanding performer"
- Common basic functions of R language: call the data editor with edit function to manually customize and edit the data object without changing the content of the original data object, and call the data
猜你喜欢

The difference between tuples and lists
![[actual combat] STM32 FreeRTOS migration series tutorial 7: FreeRTOS event flag group](/img/1c/10add042271c11cd129ddfce66f719.jpg)
[actual combat] STM32 FreeRTOS migration series tutorial 7: FreeRTOS event flag group

2. the development of the meta universe

应用配置管理,基础原理分析

Summary of Web automated testing

Stm32mp1 cortex M4 development part 10: expansion board nixie tube control

\Processing method of ufeff

【实战】STM32 FreeRTOS移植系列教程2:FreeRTOS 互斥信号量

Job hopping is better than promotion

Character function and string function
随机推荐
stm32mp1 Cortex M4开发篇13:扩展板按键外部中断
Full stack development
Alibaba cloud OSS uploading and intelligent image recognition garbage recognition
Abstractqueuedsynchronizer (AQS) source code detailed analysis - semaphore source code analysis
基于Retrotfit2.1+Material Design+ijkplayer开发的一个APP
The spring recruitment is also terrible. Ali asked at the beginning of the interview: how to design a high concurrency system? I just split
R language uses the < - operator to create new variables, uses the attach function to bind data, and directly uses the two data column names to calculate mean value to make new feelings in D
stm32mp1 Cortex M4开发篇11:扩展板蜂鸣器控制
109. use of usereducer in hooks (counter case)
Mobile applications introduce static Cordova according to different platforms
Use this for attributes in mapstate
Arcore supported devices
113. summary of common usage of moment.js
It is only seven days since the commencement of construction in 2022. I left the outsourcing company
Telecommuting Market Research Report
Three key directories in R language and their corresponding priorities: R_ Home directory, user directory, current working directory, files read by R's startup process
Common basic functions of R language: call the data editor with edit function to manually customize and edit the data object without changing the content of the original data object, and call the data
Concurrency - condition variable
ArCore支持的设备
R language uses as The date function converts a single character variable to date data and specifies the format of the data format conversion