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

在 debug 模式关闭的情况下,Field 依然会打印表单信号 #109

Closed
bestony opened this issue Jan 10, 2018 · 2 comments
Closed

Comments

@bestony
Copy link

bestony commented Jan 10, 2018

ISSUE 类型

提交 Bug

ISSUE 问题描述

在 Debug 状态为 False 时,依然会打印具体事件。

可行的解决方案

  1. 默认情况下不输出相关事件
  2. 在提供的参考 demo 中对事件进行打印
  3. 通过 app.json/app.js 中的参数进行判断是否打印相关信息。

如何复现 Bug

调用 Field 组件,参考代码
query.js

const { Field, extend } = require('../../zan/index');
Page(extend({}, Field, {
  data: {
  }, 
  formSubmit:function(e){
    console.error(e.detail.value);
  },
  handleZanFieldChange({ componentId, detail }) {
    /*
     * componentId 即为在模板中传入的 componentId
     * 用于在一个页面上使用多个 tab 时,进行区分
     * detail 即输入框中的内容
     */
    /*
     * 处理函数可以直接 return 一个字符串,将替换输入框的内容。
     */
  },
  // 输入框聚焦时触发
  handleZanFieldFocus({ componentId, detail }) { },
  // 输入框失焦时触发
  handleZanFieldBlur({ componentId, detail }) { },
}));

query.xml

<view class="doc-title zan-hairline--bottom zan-hairline--bottom">论文查询</view>

<import src="../../zan/field/index.wxml" />
<form bindsubmit="formSubmit">

  <template is="zan-field" data="{{ title: '作者名',name : 'author', inputType:'text', type: 'input', placeholder: '请输入作者姓名' }}"></template>

  <template is="zan-field" data="{{ title: '电话号码',name : 'phone', inputType:'text', type: 'input', placeholder: '请输入您留下的电话号码' }}"></template>

  <view class="zan-btns">
    <button class="zan-btn zan-btn--primary" formType="submit">提交信息</button>
    <button class="zan-btn" formType="reset">重置数据</button>
  </view>
</form>

Bug 截图

default

@pangxie1991
Copy link
Collaborator

微信的 debug 选项只是屏蔽了微信本身的调试信息输出。这边信息是组件内部输出的,所以和 debug 选项无关

这里的信息是会有点干扰,后面会把它统一干掉

@pangxie1991
Copy link
Collaborator

下个版本就会清理掉多余的日志信息

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

No branches or pull requests

2 participants