vue自定义组件的总结(一)
1.定义组件时
<template>
<input
class="input"
:type="type"
:placeholder="placeholder"
@focus="handleChange()"
:style="style"
/>
</template>
在template里直接写功能标签,在父组件使用时,要在外面加一层div,所有事件操作不会在自定义组件标签上生效,但会在外层div生效
<div @change="handleInputAccountChange($event)">
<input-box
class="input-box inputAccountBox"
:type="textType"
:placeholder="inputAccount"
/>
</div>

浙公网安备 33010602011771号