wxc-input

    基础用法

    1. <view class="container">
    2. <view class="input-wrap">
    3. <wxc-input type="text" title="收货人" placeholder="名字"></wxc-input>
    4. <wxc-input type="number" title="联系电话" placeholder="请输入手机号"></wxc-input>
    5. <wxc-input type="text" title="详细地址" mode="none" placeholder="请输入详细地址"></wxc-input>
    6. </view>
    7. </view>
    8. </template>
    9. <script>
    10. export default {
    11. config: {
    12. usingComponents: {
    13. 'wxc-input': '@minui/wxc-input'
    14. }
    15. },
    16. data: { },
    17. methods: { }
    18. }
    19. </script>
    20. <style>
    21. .container {
    22. width: 100%;
    23. }
    24. .input-wrap {
    25. background: #fff;
    26. }
    27. </style>

    带icon的输入框

    无标题输入框

    输入框 input - 图3

    1. <template>
    2. <wxc-input type="text" placeholder="请输入收货人姓名"></wxc-input>
    3. </template>
    4. <script>
    5. export default {
    6. config: {
    7. usingComponents: {
    8. 'wxc-input': '@minui/wxc-input'
    9. }
    10. },
    11. data: { },
    12. methods: { }
    13. }
    14. </script>
    15. <style>
    16. </style>

    圆角输入框

    输入框 input - 图5

    1. <template>
    2. <view class="input-wrap">
    3. <wxc-input type="number" mode="wrapped" right="{{true}}" title="消费总额" placeholder="询问收银员后输入"></wxc-input>
    4. <view class="input-wrap">
    5. </view>
    6. <view class="input-wrap">
    7. <wxc-input type="number" mode="wrapped" placeholder="请输入消费金额"></wxc-input>
    8. </view>
    9. </template>
    10. <script>
    11. export default {
    12. config: {
    13. usingComponents: {
    14. 'wxc-input': '@minui/wxc-input'
    15. }
    16. },
    17. data: { },
    18. methods: { }
    19. }
    20. </script>
    21. <style>
    22. .input-wrap {
    23. position: relative;
    24. margin: 20rpx 10rpx 0 10rpx;
    25. }
    26. </style>

    Input

    小程序组件系统中组件是隔离的,所以提交表单时无法用 表单获取输入框中的值,只能单独获取。

    v1.0.0(2018-3-29)