Skip to content

[vue] 说说你对vue的表单修饰符.lazy的理解 #458

Open
@haizhilin2013

Description

@haizhilin2013
Collaborator

[vue] 说说你对vue的表单修饰符.lazy的理解

Activity

wangjinA

wangjinA commented on Jun 29, 2019

@wangjinA

input标签v-model用lazy修饰之后,vue并不会立即监听input Value的改变,会在input失去焦点之后,才会触发input Value的改变

Funtience

Funtience commented on Jul 21, 2019

@Funtience

v-model默认的触发条件是input事件,加了.lazy修饰符之后,v-model会在change事件触发的时候去监听

jiangxiaohui000

jiangxiaohui000 commented on May 11, 2022

@jiangxiaohui000

在默认情况下,v-model 在每次 input 事件触发后将输入框的值与数据进行同步 (除了(https://v3.cn.vuejs.org/guide/forms.html#vmodel-ime-tip)输入法组织文字时)。你可以添加 lazy 修饰符,从而转为在 change 事件之后进行同步:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @haizhilin2013@jiangxiaohui000@wangjinA@Funtience

        Issue actions

          [vue] 说说你对vue的表单修饰符.lazy的理解 · Issue #458 · haizlin/fe-interview