Skip to content

Commit c6b24de

Browse files
author
caoli
committed
fix: el-table click error
1 parent a4b2b54 commit c6b24de

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

app/web/page/admin/home/store/app/actions.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ import axios from 'axios';
77

88
Vue.use(Vuex);
99

10-
const host = 'http://localhost:7001';
11-
1210
const actions = {
1311

1412
FETCH_ARTICLE_LIST: ({ commit, dispatch, state }, condition) => {
15-
return axios.post(`${host}/admin/api/article/list`, condition, {
13+
return axios.post(`/admin/api/article/list`, condition, {
1614
headers: {
1715
'x-csrf-token': state.csrf,
1816
'Cookie': `csrfToken=${state.csrf}`
@@ -23,14 +21,14 @@ const actions = {
2321
},
2422

2523
FETCH_ARTICLE_DETAIL: ({ commit, dispatch, state }, { id }) => {
26-
return axios.get(`${host}/admin/api/article/${id}`)
24+
return axios.get(`/admin/api/article/${id}`)
2725
.then(response => {
2826
commit(Type.SET_ARTICLE_DETAIL, response.data);
2927
});
3028
},
3129

3230
SAVE_ARTICLE: ({ commit, dispatch, state }, data) => {
33-
return axios.post(`${host}/admin/api/article/add`, data, {
31+
return axios.post(`/admin/api/article/add`, data, {
3432
headers: {
3533
'x-csrf-token': state.csrf,
3634
}

app/web/page/admin/home/view/list.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@
6262
width="180">
6363
<template slot-scope="props">
6464
<router-link :to="{name: 'tableUpdate', params: {id: props.row.id}}" tag="span">
65-
<el-button type="info" size="small" icon="edit">修改</el-button>
65+
<el-button type="info" size="small" icon="edit" @click="handleEdit(props.$index, props.row)">修改</el-button>
6666
</router-link>
67-
<el-button type="danger" size="small" icon="delete" @click="delete_data(props.row)">删除</el-button>
67+
<el-button type="danger" size="small" icon="delete" @click="handleDelete(props.$index, props.row)">删除</el-button>
6868
</template>
6969
</el-table-column>
7070
</el-table>

webpack.config.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
'use strict';
2-
const path = require('path');
3-
const ServiceWorkerWebpackPlugin = require('service-worker-precache-webpack-plugin');
42
module.exports = {
53
egg: true,
64
framework: 'vue',

0 commit comments

Comments
 (0)