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

边栏推荐
猜你喜欢

Yesterday, Alibaba senior wrote a responsibility chain model, and there were countless bugs

Ali was wildly asked by the interviewer on three sides. Redis dared not write 'proficient' on his resume anymore

A simple PHP personal card issuing program v4.0

又一所双非改考408,会爆冷么?南昌航空大学软件学院

Uncover the whole link communication process of dewu customer service im

Redis(6)----对象与数据结构

【愚公系列】2022年07月 Go教学课程 001-Go语言前提简介

Leetcode (81) -- search rotation sort array II

故障排查:kubectl报错ValidationError: unknown field \u00a0

Industrial software lecture - core technology analysis of 3D CAD design software - the second lecture of the Forum
随机推荐
谷歌官方回应:我们没有放弃TensorFlow,未来与JAX并肩发展
promise 和 Observable 的区别
CDN acceleration and breaking J anti-theft chain function
In early summer, Kaiyuan magic changed an electric mosquito racket with killing sound effect!
exness深度好文:动性系列-黄金流动性实例分析(五)
Leetcode interview question 17.01 Addition without plus sign
NM01-独立于总线协议的NM模块功能概述与API定义
SteamOS 3.3 Beta 发布,Steam Deck 中文键盘终于来了
Qt官方示例:Qt Quick Controls - Gallery
M2DGR:多源多场景 地面机器人SLAM数据集(ICRA 2022 )
Leetcode 面试题 16.17. 连续数列
【Oracle 期末复习】表空间、表、约束、索引、视图的增删改
Qt官方示例:Qt Quick Controls - Gallery
SLAM|如何时间戳对齐?
能解决80%故障的排查思路
故障排查:kubectl报错ValidationError: unknown field \u00a0
阿里三面被面试官狂问Redis,简历上再也不敢写'精通'了
深度神经网络总结
问题包含哪些环节
哪个券商公司网上开户佣金低又安全又可靠