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

textarea 无法初始化值 #561

Open
striveniu opened this issue May 15, 2021 · 1 comment
Open

textarea 无法初始化值 #561

striveniu opened this issue May 15, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@striveniu
Copy link

striveniu commented May 15, 2021

bug描述
web端textarea无法初始化值。<textarea value="{{textValue}}" >{{textValue}}</textarea>

复现bug的步骤

  1. 直接在页面定义textValue值,然后定义textarea组件,设置value=textValue
  2. 进入页面无法初始化值

如下为示例代码

<template>
  <page title="chameleon">
      <scroller height="{{-1}}">
        <view class="scroller-wrap">
          <textarea value="{{textValue}}" >{{textValue}}</textarea>
        </view>
      </scroller>
  </page>
</template>
<script>
class Index  {
  data = {
    title: "chameleon",
    textValue: "this is a test"
  }
  methods = {
    bindblurevent() {
      console.log('blur');
      this.isfocus = false;
    },
  };
}
export default new Index();
</script>

问题截图
只是一个空的textarea

编译环境信息

  • chameleon-tool 版本:[email protected]
  • nodejs版本、npm版本:node:v12.20.1 npm:6.14.10
  • 电脑操作系统: macOS Catalina 10.15.7

运行环境信息

  • 端版本:macOS Chrome浏览器 90.0.4430.212
@striveniu striveniu added the bug Something isn't working label May 15, 2021
@zhaoyinpan2
Copy link

bug描述
web端textarea无法初始化值。<textarea value="{{textValue}}" >{{textValue}}</textarea>

复现bug的步骤

  1. 直接在页面定义textValue值,然后定义textarea组件,设置value=textValue
  2. 进入页面无法初始化值

如下为示例代码

<template>
  <page title="chameleon">
      <scroller height="{{-1}}">
        <view class="scroller-wrap">
          <textarea value="{{textValue}}" >{{textValue}}</textarea>
        </view>
      </scroller>
  </page>
</template>
<script>
class Index  {
  data = {
    title: "chameleon",
    textValue: "this is a test"
  }
  methods = {
    bindblurevent() {
      console.log('blur');
      this.isfocus = false;
    },
  };
}
export default new Index();
</script>

问题截图
只是一个空的textarea

编译环境信息

  • chameleon-tool 版本:[email protected]
  • nodejs版本、npm版本:node:v12.20.1 npm:6.14.10
  • 电脑操作系统: macOS Catalina 10.15.7

运行环境信息

  • 端版本:macOS Chrome浏览器 90.0.4430.212

我试了你的代码,没有问题的

1.clm需要用c-bind:input更改textValue的值
2.你需要设置下textarea的宽度(误以为没初始值)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants