12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <template>
- <div style="width:auto; display:inline-block !important;">
- <a-divider v-if="showDivider" type="vertical" />
- <a v-if="type === 1" :style="myStyle" @click="$emit('click')">{{ text == null?$slots.default[0].text : text }}</a>
- <a-popconfirm v-if="type === 2" :title="title" @confirm="$emit('confirm')">
- <a>{{ text == null?$slots.default[0].text : text }}</a>
- </a-popconfirm>
- </div>
- </template>
- <script>
- export default {
- name: 'OperationButton',
- props: {
- type: { // 1.表示A标签,2.表示
- type: Number,
- default: 1
- },
- text: { // 按钮显示文本
- type: String,
- default: null
- },
- showDivider: { // 按钮显示文本
- type: Boolean,
- default: true
- },
- title: {
- type: String,
- default: '亲,开发忘了给提示,请通知管理员杀了祭天'
- },
- myStyle: {
- type: Object,
- default: () => ({})
- }
- },
- data () {
- return {
- }
- },
- computed: {
- },
- created () {
- },
- updated: function () {
- }
- }
- </script>
- <style scoped>
- </style>
|