update Button & Table Cell

Button add custom event @click,you can use @click in i-button now;
Table Cell support data from content
This commit is contained in:
梁灏 2017-03-15 15:27:04 +08:00
parent 2ac208b99d
commit 99d0429e27
4 changed files with 231 additions and 289 deletions

View file

@ -1,5 +1,5 @@
<template>
<button :type="htmlType" :class="classes" :disabled="disabled">
<button :type="htmlType" :class="classes" :disabled="disabled" @click="handleClick">
<Icon class="ivu-load-loop" type="load-c" v-if="loading"></Icon>
<Icon :type="icon" v-if="icon && !loading"></Icon>
<span v-if="showSlot" ref="slot"><slot></slot></span>
@ -64,8 +64,13 @@
];
}
},
methods: {
handleClick (event) {
this.$emit('click', event);
}
},
mounted () {
this.showSlot = this.$refs.slot.innerHTML.replace(/\n/g, '').replace(/<!--[\w\W\r\n]*?-->/gmi, '') !== '';
this.showSlot = this.$slots.default !== undefined;
}
};
</script>