diff --git a/src/api/table.js b/src/api/table.js new file mode 100644 index 0000000..b475c0a --- /dev/null +++ b/src/api/table.js @@ -0,0 +1,11 @@ +import fetch from '@/utils/fetch'; + +export function getList(params) { + return fetch({ + url: '/table/list', + method: 'get', + params + }); +} + + diff --git a/src/router/index.js b/src/router/index.js index 4dc9849..63719e9 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -16,7 +16,8 @@ const dashboard = _import('dashboard/index'); /* error page */ const Err404 = _import('404'); -const Page = _import('page/index'); +const Form = _import('page/form'); +const Table = _import('table/index'); Vue.use(Router); @@ -51,11 +52,20 @@ export const asyncRouterMap = [ path: '/example', component: Layout, redirect: 'noredirect', - name: 'page', - icon: 'zonghe', + name: 'Example', + icon: 'zujian', children: [ - { path: 'index', component: Page, name: 'page' } + { path: 'index', component: Form, name: 'Form', icon: 'zonghe' } ] }, + { + path: '/table', + component: Layout, + redirect: '/table/index', + name: 'Table', + icon: 'tubiaoleixingzhengchang', + noDropdown: true, + children: [{ path: 'index', component: Table, name: 'Table', meta: { role: ['admin'] } }] + }, { path: '*', redirect: '/404', hidden: true } ]; diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index cd558ee..52cc61c 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -1,7 +1,8 @@ - - {{name}} - + + name:{{name}} + role:{{role}} + + + diff --git a/src/views/page/form.vue b/src/views/page/form.vue new file mode 100644 index 0000000..95dd746 --- /dev/null +++ b/src/views/page/form.vue @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + 立即创建 + 取消 + + + + + + diff --git a/src/views/page/index.vue b/src/views/page/index.vue deleted file mode 100644 index 56dc105..0000000 --- a/src/views/page/index.vue +++ /dev/null @@ -1,5 +0,0 @@ - - - a - - diff --git a/src/views/table/index.vue b/src/views/table/index.vue new file mode 100644 index 0000000..a9e3fb8 --- /dev/null +++ b/src/views/table/index.vue @@ -0,0 +1,57 @@ + + + + + + {{scope.$index}} + + + + + {{scope.row.title}} + + + + + + {{scope.row.author}} + + + + + {{scope.row.pageviews}} + + + + + + {{scope.row.display_time}} + + + + + + +