this.$nextTick(() => {
// 初始化Textarea编辑开关
$vm.editableTextarea();
});
data() {
return {
s_scrollStyle: (() => {
return this.scrollStyle;
})(), // props 是否渲染滚动条样式
s_preview_switch: (() => {
let default_open_ = this.defaultOpen;
if (!default_open_) {
default_open_ = this.subfield ? "preview" : "edit";
}
return default_open_ === "preview" ? true : false;
})(), // props true 展示编辑 false展示预览
}
}
const { count, dataSource } = this
const newData = {
key: count,
name: `Edward King ${count}`,
age: 32,
address: `London, Park Lane no. ${count}`,
}
this.dataSource = [...dataSource, newData]
this.count = count + 1
onDelete (key) {
const dataSource = [...this.dataSource]
this.dataSource = dataSource.filter(item => item.key !== key)
},
<a-button class="editable-add-btn" @click="handleAdd">Add</a-button>
评论区