Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Taro3.4.2 Vue2 H5 input 输入框 v-model 和 value无法初始化 #11333

Closed
15380831711 opened this issue Feb 22, 2022 · 2 comments
Closed

Taro3.4.2 Vue2 H5 input 输入框 v-model 和 value无法初始化 #11333

15380831711 opened this issue Feb 22, 2022 · 2 comments
Labels
F-vue2 Framework - Vue 2 P-2 Medium, minor/patch T-h5 Target - 编译到 H5 V-3 Version - 3.x
Milestone

Comments

@15380831711
Copy link

15380831711 commented Feb 22, 2022

相关平台

H5

复现仓库

https://github.com/NervJS/

使用框架: Vue 2

复现步骤

taro cli 创建最新vue2工程,

<template>
    <view>
        <input type="text" v-model="name" placeholder="name" :value="name" />
    </view>
</template>

<script>
    export default {
        data() {
            return { name: "" };
        },
        onLoad() {
            setTimeout(() => {
                this.name = "xxx";
            }, 1000);
        }
    };
</script>

期望结果

输入框value正常初始化

实际结果

未初始化

环境信息

  Taro CLI 3.4.2 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 14.16.0 - D:\ProgramFiles\node\node.EXE
      Yarn: 1.22.10 - D:\ProgramFiles\node\yarn.CMD
      npm: 6.14.11 - D:\ProgramFiles\node\npm.CMD  
@taro-bot2 taro-bot2 bot added F-vue2 Framework - Vue 2 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Feb 22, 2022
@15380831711 15380831711 changed the title Taro3.4.2 Vue2 input 输入框 v-model 和 value无法初始化 Taro3.4.2 Vue2 H5 input 输入框 v-model 和 value无法初始化 Feb 22, 2022
@wangjunjia
Copy link
Contributor

  1. H5 没有 onLoad , 可以改成 mounted ,
  2. setTimeout 之后没有更新这个很奇怪

@ZakaryCode
Copy link
Contributor

ZakaryCode commented Jul 21, 2022

  1. H5 没有 onLoad , 可以改成 mounted

好像是 3.4 版本后就有支持,具体可以自行验证一下

  1. setTimeout 之后没有更新这个很奇怪

vue attr 更新问题, 3.5+ 版本修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-vue2 Framework - Vue 2 P-2 Medium, minor/patch T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects
Archived in project
Development

No branches or pull requests

3 participants