代码拉取完成,页面将自动刷新
同步操作将从 heyui/heyui 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>HeyUI</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/heyui/themes/index.css">
</head>
<body>
<div id="app" v-padding="20">
<div v-height="50">
<SwitchList :datas="labels" v-model="labelPosition" :small="true"></SwitchList>
</div>
<h-form ref="form" :label-position="labelPosition" :label-width="90" :rules="validationRules" :model="model">
<h-formitem label="用户名" prop="name">
<input type="text" v-model="model.name" />
</h-formitem>
<h-formitem label="密码" prop="password">
<input type="password" v-model="model.password" />
</h-formitem>
<h-formitem>
<h-button color="primary" :loading="isLoading" @click="submit">提交</h-button>
<h-button @click="reset">取消</h-button>
</h-formitem>
</h-form>
</div>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="https://cdn.jsdelivr.net/npm/heyui"></script>
<script>
var app = new Vue({
el: '#app',
data: {
isLoading: false,
labelPosition: "left",
labels: {
left: 'Label左对齐',
right: 'Label右对齐',
},
model: {
name: "",
password: ""
},
validationRules: {
required: [
'name',
'password'
]
}
},
methods: {
submit() {
this.isLoading = true;
let validResult = this.$refs.form.valid();
if (validResult.result) {
this.$Message("验证成功");
setTimeout(() => {
this.isLoading = false;
}, 1000);
} else {
this.isLoading = false;
}
},
reset() {
this.$refs.form.reset();
}
}
})
</script>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。