当前位置:网站首页>Hongmeng's fourth learning
Hongmeng's fourth learning
2022-07-02 18:44:00 【Rookie no】
1.tabs
2.list
3. Custom components
Custom components are used by users according to business requirements , Combine existing components , Packaged into new components , You can call... Multiple times in a project , To improve the readability of the code . Custom components are created through element Introduce to the host page , How to use it is as follows :
<element name='comp' src='../../common/component/comp.hml'></element>
<div>
<comp prop1='xxxx' @child1="bindParentVmMethod"></comp>
</div>
combination if-else Examples of using custom components :
<element name='comp1' src='../../common/component/comp1/comp1.hml'></element>
<element name='comp2' src='../../common/component/comp2/comp2.hml'></element>
<div>
<comp1 if="{
{showComp1}}" prop1='xxxx' @child1="bindParentVmMethodOne"></comp1>
<comp2 else prop1='xxxx' @child1="bindParentVmMethodTwo"></comp2>
</div>
- name Property refers to the custom component name ( Not required ), Component names are case insensitive , The default is lowercase .src Properties refer to custom components hml File path ( Required ), If not set name attribute , It is used by default hml Use the file name as the component name .
- Event binding : Binding subcomponent events in custom components use (on|@)child1 grammar , Passed in the child component this.$emit('child1', { params: ' Pass parameters ' }) Trigger the event and transfer the value , Parent component execution bindParentVmMethod Method and receive the parameters passed by the subcomponent .
边栏推荐
- Leetcode (81) -- search rotation sort array II
- Wechat applet video sharing platform system graduation design completion (5) assignment
- What is cloud primordial? This time, I can finally understand!
- 揭秘得物客服IM全链路通信过程
- Deep neural network Summary
- 饭卡 HDU2546
- 谷歌官方回应:我们没有放弃TensorFlow,未来与JAX并肩发展
- How to write controller layer code gracefully?
- QT official example: QT quick controls - Gallery
- Pit encountered during installation of laravel frame
猜你喜欢
Esp32-c3 introductory tutorial question ⑩ - error: implicit declaration of function 'ESP_ blufi_ close‘;
A simple PHP personal card issuing program v4.0
UE4 用spline画正圆
Wechat applet video sharing platform system graduation design completion (7) Interim inspection report
Leetcode 面试题 16.15. 珠玑妙算
文字编辑器 希望有错误的句子用红色标红,文字编辑器用了markdown
深度学习数学基础
300+ documents! This article explains the latest progress of multimodal learning based on transformer
Comprendre complètement le tutoriel de traitement de Point Cloud basé sur open3d!
Unity learning shader notes [82] black and white processing of enhanced single channel color rendering
随机推荐
Leetcode 面试题 16.15. 珠玑妙算
How to use PS to extract image color and analyze color matching
Wechat nucleic acid detection appointment applet system graduation design completion (5) task statement
Steamos 3.3 beta release, steam deck Chinese keyboard finally came
1.5.1版本官方docker镜像运行容器,能设置使用 mysql 8驱动吗?
Matlab中弧度转角度、角度转弧度
深度学习数学基础
SLAM|如何时间戳对齐?
【每日一题】第二天
元宇宙链游系统开发(逻辑开发)丨链游系统开发(详细分析)
QT official example: QT quick controls - Gallery
Which securities company has a low, safe and reliable online account opening commission
How to set vscode to delete the whole line shortcut key?
Leetcode 面试题 17.01. 不用加号的加法
Concepts and differences of PR curve and ROC curve
Redis (6) -- object and data structure
Typical application of "stack" - expression evaluation (implemented in C language)
Nm02 nm module call sequence diagram and code interpretation independent of bus protocol
Server PHP environment building tutorial, PHP server environment building graphic explanation
Slam | how to align timestamps?