当前位置:网站首页>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 .

边栏推荐
- A simple PHP personal card issuing program v4.0
- Leetcode(154)——寻找旋转排序数组中的最小值 II
- 学生抖音宣传母校被吐槽“招生减章”,网友:哈哈哈哈哈哈
- Leetcode (81) -- search rotation sort array II
- ESP32-C3入门教程 问题篇⑪——esp-tls: create_ssl_handle failed, tls_io_instance->options.trusted_certs null
- Leetcode 面试题 16.17. 连续数列
- Qt官方示例:Qt Quick Controls - Gallery
- promise 和 Observable 的区别
- Leetcode 面试题 17.01. 不用加号的加法
- Chrome officially supports MathML, which is enabled in chromium dev 105 by default
猜你喜欢

Wechat nucleic acid detection appointment applet system graduation design completion (5) task statement

Summary of fun free GM games

Web版3D可视化工具,程序员应该知道的97件事,AI前沿论文 | 资讯日报 #2022.07.01

实施阴影介绍

再放宽!这些应届生,可直接落户上海

CDN acceleration and breaking J anti-theft chain function

Wechat applet video sharing platform system graduation design (3) background function

鸿蒙第四次学习

Qt Official examples: Qt Quick Controls - Gallery

阿里三面被面试官狂问Redis,简历上再也不敢写'精通'了
随机推荐
Leetcode (81) -- search rotation sort array II
Chrome 正式支持 MathML,默认在 Chromium Dev 105 中启用
Leetcode interview question 16.17 Continuous sequence
Leetcode 面试题 17.04. 消失的数字
元宇宙链游系统开发(逻辑开发)丨链游系统开发(详细分析)
Wechat nucleic acid detection appointment applet system graduation design completion (1) development outline
Détends - toi encore! Ces nouveaux étudiants peuvent s'installer directement à Shanghai
怎么用ps提取图片颜色分析色彩搭配
一款简约PHP个人发卡程序V4.0版本
如何优雅的写 Controller 层代码?
Implementation shadow introduction
Please, stop painting star! This has nothing to do with patriotism!
Rte11 interrupt decoupling function
链游系统开发(Unity3D链游开发详情)丨链游开发成熟技术源码
Relax again! These fresh students can settle directly in Shanghai
cJSON 使用详解
Responses of different people in technology companies to bugs | daily anecdotes
Matlab中弧度转角度、角度转弧度
又一所双非改考408,会爆冷么?南昌航空大学软件学院
Yesterday, Alibaba senior wrote a responsibility chain model, and there were countless bugs