<div id="app">
<i-button type="primary" @click="add">添加</i-button>
<i-table :columns="col" :data="list" style="margin-top: 20px;margin-bottom: 20px;"></i-table>
<Page :total="page.total" :page-size="page.pageSize" @on-change="getList"/>
<Modal v-model="addModal" title="添加" @on-ok="addModalF">
<span>域名</span>
<i-input v-model="addVal"/>
</Modal>
<Modal v-model="editModal" title="编辑" @on-ok="editModalF">
<span>域名</span>
<i-input v-model="editInfo.domain" type="text"/>
</Modal>
</div>
<script>
var vm = new Vue({
el: "#app",
data() {
let self = this;
return {
addModal: true,
editModal: false,
addVal: '',
col: [
{
title: "ID",
key: "id"
},
{
title: "域名",
key: "domain"
},
{
title: "操作",
key: "action",
align: "center",
render: (h, params) => {
return h('div', [
h('Button', {
props: {
type: 'primary',
size: 'small'
},
style: {
marginRight: '5px'
},
on: {
click: () => {
self.edit(params.index)
}
}
}, '编辑'),
h('Button', {
props: {
type: 'error',
size: 'small'
},
on: {
click: () => {
console.log(params);
self.del(params.index)
}
}
}, '删除')
]);
}
}
],
list: [],
editInfo: {},
page: {
total: 0,
pageSize: 0
}
}
},
created: function () {
this.getList();
},
methods: {
getList(page) {
//dosoming
},
add() {
var self = this;
self.addModal = true;
},
}
哪个失效,没描述清楚,而且事件名没对应上还是什么