index.vue 2.4 KB
Newer Older
Pan's avatar
Pan committed
1
<template>
Pan's avatar
Pan committed
2
  <div class="app-container">
3 4
    <el-form ref="form" :model="form" label-width="120px">
      <el-form-item label="Activity name">
5
        <el-input v-model="form.name"/>
Pan's avatar
Pan committed
6
      </el-form-item>
7 8
      <el-form-item label="Activity zone">
        <el-select v-model="form.region" placeholder="please select your zone">
9 10
          <el-option label="Zone one" value="shanghai"/>
          <el-option label="Zone two" value="beijing"/>
Pan's avatar
Pan committed
11 12
        </el-select>
      </el-form-item>
13
      <el-form-item label="Activity time">
Pan's avatar
Pan committed
14
        <el-col :span="11">
15
          <el-date-picker v-model="form.date1" type="date" placeholder="Pick a date" style="width: 100%;"/>
Pan's avatar
Pan committed
16
        </el-col>
17
        <el-col :span="2" class="line">-</el-col>
Pan's avatar
Pan committed
18
        <el-col :span="11">
19
          <el-time-picker v-model="form.date2" type="fixed-time" placeholder="Pick a time" style="width: 100%;"/>
Pan's avatar
Pan committed
20 21
        </el-col>
      </el-form-item>
22
      <el-form-item label="Instant delivery">
23
        <el-switch v-model="form.delivery"/>
Pan's avatar
Pan committed
24
      </el-form-item>
25
      <el-form-item label="Activity type">
Pan's avatar
Pan committed
26
        <el-checkbox-group v-model="form.type">
27 28 29 30
          <el-checkbox label="Online activities" name="type"/>
          <el-checkbox label="Promotion activities" name="type"/>
          <el-checkbox label="Offline activities" name="type"/>
          <el-checkbox label="Simple brand exposure" name="type"/>
Pan's avatar
Pan committed
31 32
        </el-checkbox-group>
      </el-form-item>
33
      <el-form-item label="Resources">
Pan's avatar
Pan committed
34
        <el-radio-group v-model="form.resource">
35 36
          <el-radio label="Sponsor"/>
          <el-radio label="Venue"/>
Pan's avatar
Pan committed
37 38
        </el-radio-group>
      </el-form-item>
39
      <el-form-item label="Activity form">
40
        <el-input v-model="form.desc" type="textarea"/>
Pan's avatar
Pan committed
41 42
      </el-form-item>
      <el-form-item>
43
        <el-button type="primary" @click="onSubmit">Create</el-button>
Pan's avatar
Pan committed
44
        <el-button @click="onCancel">Cancel</el-button>
Pan's avatar
Pan committed
45 46 47
      </el-form-item>
    </el-form>
  </div>
Pan's avatar
Pan committed
48 49 50
</template>

<script>
Pan's avatar
Pan committed
51 52 53 54 55 56 57 58 59 60 61 62
export default {
  data() {
    return {
      form: {
        name: '',
        region: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: ''
Pan's avatar
Pan committed
63 64
      }
    }
Pan's avatar
Pan committed
65 66 67
  },
  methods: {
    onSubmit() {
68
      this.$message('submit!')
Pan's avatar
Pan committed
69 70 71 72 73 74
    },
    onCancel() {
      this.$message({
        message: 'cancel!',
        type: 'warning'
      })
Pan's avatar
Pan committed
75
    }
Pan's avatar
Pan committed
76
  }
Pan's avatar
Pan committed
77
}
Pan's avatar
Pan committed
78
</script>
Pan's avatar
Pan committed
79 80 81 82 83 84 85

<style scoped>
.line{
  text-align: center;
}
</style>