ant-design 基础格式

1 格式

<template>
    <div>
        <center><h1>这是·注册页面</h1></center>

        <a-form-item label="用户名" v-bind="formlayout">
          <a-input v-model="username"/>
        </a-form-item >

        <a-form-item v-bind="buttonlayout"  >
        <a-button type="primary"  @click="submit">注册</a-button>
        </a-form-item>

    </div>
</template>
<script type="text/javascript">
    export  default {
      data(){
        return{
        username:'',
          // 表单样式
          formlayout:{
          //标签
          labelCol:{
            xs:{span:24},
            sm:{span:8}
          },
            // 文本框
            wrapperCol:{
            xs:{span:24},
            sm:{span:16}
            }
          },
          // 按钮样式
          buttonlayout:{
          //标签
          wrapperCol:{
            xs:{
              span:24,
              offset:0
            },
            sm:{span:16,offset:8}
          },
          }
        }
      }
</script>

  

posted @ 2020-10-27 21:56  睁yan-ii  阅读(741)  评论(0编辑  收藏  举报