1234567891011121314151617181920212223242526272829303132333435 |
- <template>
- <div id="c-btnbar">
- <el-row class="rows">
- <el-col :span="24" class="main">
- <el-col :span="24" class="one">
- <el-button v-for="i in list" :key="i.method" :type="i.type ? i.type : 'primary'" plain size="mini" @click="toOpera(i)">{{ i.label }}</el-button>
- <slot></slot>
- </el-col>
- </el-col>
- </el-row>
- </div>
- </template>
- <script>
- export default {
- name: 'c-btnbar',
- props: {
- list: { type: Array, default: () => [] },
- },
- data: function () {
- return {};
- },
- methods: {
- toOpera(item) {
- this.$emit(item.method);
- },
- },
- };
- </script>
- <style lang="less" scoped>
- .rows {
- margin: 20px 0;
- }
- </style>
|