# 官方文檔:
https://uniapp.dcloud.io/component/button.html
## 語法:
```
<button type="primary">提交按鈕</button>
```
## 提交表單
form-type="submit"
```
<button type="primary" form-type="submit">提交按鈕</button>
```
```
<form @submit="sub" @reset=""> <form/> //提交表單 sub為函數
```
## picker 用input隱藏方法提交
```
<picker mode="selector" :range="lanuage" @change="picChange">
<view>{{lanuage[index]}}</view>
<input type="text" name="lan" :value="lanuage[index]" hidden />
</picker>
```
## 代碼案例:
```
<template>
<view class="content">
<form @submit="sub">
<input class="uni-input" name="test" type="text" value="" />
<!-- 彈窗選擇 -->
<text>picker:</text>
<picker mode="selector" :range="lanuage" @change="picChange">
<view>{{lanuage[index]}}</view>
<input type="text" name="lan" :value="lanuage[index]" hidden />
</picker>
<!-- 彈窗選擇 -->
<button type="primary" form-type="submit">提交按鈕</button>
</form>
</view>
</template>
<script>
export default {
data() {
return {
lanuage:['java','php','js','css','c++'],
index:0 //獲取數組下標
}
},
onLoad() {
},
methods: {
sub:function(e){
console.log(e);
},
picChange(e){
this.index=e.detail.value; //返回數組下標
}
}
}
</script>
<style>
input{
background-color:#999799;
}
</style>
```
- pages.json配置
- pages.json導航配置(項目導航設置)
- app.vue應用生命周期
- 頁面生命周期
- app.vue設置全局共享數據(getApp().globalDate)
- 組件view
- view阻止冒泡
- 組件scroll-view
- 組件swiper(制作幻燈片用)
- 組件rich-text (富文本)
- 組件progress(進度條)
- 媒體組件
- 表單form組件
- 表單input
- 表單textarea
- 組件復選框與單選框
- 組件picker底部拉起滾動器
- 組件button提交按鈕
- 組件---確認框
- uView使用
- 組件導航
- 網絡請求GET與POST
- 數據緩存(做登陸驗證時候用)
- 網絡接口封裝