https://developers.weixin.qq.com/miniprogram/dev/component/form.html
<template>
<view class="content">
<form @submit="formSubmit">
<radio-group name="技术">
<view>
<text>Bug?</text>
</view>
<label>
<text>是的</text>
<radio></radio>
</label>
<label>
<text>不是 是机制</text>
<radio></radio>
</label>
</radio-group>
<view>
<button form-type="submit">
<text>可以提交</text>
</button>
<form-submit-auto>
<button form-type="submit">
<text>试试看</text>
</button>
</form-submit-auto>
<form-submit></form-submit>
</view>
</form>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
formSubmit(evt) {
console.log('evt: ', evt);
}
}
}
</script>
<style>
</style>
组件
<template>
<view>
<button form-type="submit">
<text> 组件提交 </text>
</button>
</view>
</template>
<script>
export default {
name: "form-submit",
data() {
return {
};
}
}
</script>
<style lang="scss">
</style>
组件2
<template>
<view>
<slot></slot>
</view>
</template>
<script>
export default {
name:"form-submit-auto",
data() {
return {
};
}
}
</script>
<style lang="scss">
</style>
用的是 uni-app 开发 由于微信小程序本身的Bug 太多 所以感觉不对 第一个自然找你们