dai-vue-module-m

自动化上传

2022/4/13 15:59:44

更改列表

api.js 19(+19 -0)

config.js 7(+7 -0)

index.js 9(+9 -0)

page/index.vue 30(+30 -0)

routes.js 11(+11 -0)

详细信息

api.js 19(+19 -0)

diff --git a/api.js b/api.js
new file mode 100644
index 0000000..1ad3eb2
--- /dev/null
+++ b/api.js
@@ -0,0 +1,19 @@
+var test = {
+    $config: {
+        /**读取配置文件中 service 字段,默认 default*/
+        service: 'default',
+        /**基础URL */
+        baseURL: '/test/'
+        /**请求方式,不配置为 payload*/
+        // requestType: 'formData'
+    },
+    /**
+     * 接口方法  在 vue 页面中可以使用方法  await this.$api.test.test({});
+     * @param {Object} data
+     * @returns
+     */
+    async test(data) {
+        return await this.$get('test', data);
+    }
+};
+export { test };

config.js 7(+7 -0)

diff --git a/config.js b/config.js
new file mode 100644
index 0000000..a501340
--- /dev/null
+++ b/config.js
@@ -0,0 +1,7 @@
+const config = {
+    /** 模块通用样式类,此样式类会对整个模块生效
+     * @type {String}
+     */
+    className: '${className}'
+};
+export default config;

index.js 9(+9 -0)

diff --git a/index.js b/index.js
new file mode 100644
index 0000000..d7e2c2c
--- /dev/null
+++ b/index.js
@@ -0,0 +1,9 @@
+import * as api from './api.js';
+import routes from './routes.js';
+import './static/style/style.less';
+const models = {};
+export default {
+    api,
+    routes,
+    models
+};

page/index.vue 30(+30 -0)

diff --git a/page/index.vue b/page/index.vue
new file mode 100644
index 0000000..1260bdf
--- /dev/null
+++ b/page/index.vue
@@ -0,0 +1,30 @@
+<style lang="less" scoped>
+</style>
+<template>
+    <div style="text-align: center;">
+        <div><img style="width:200px;" src="../static/image/vue-logo.png" /></div>
+        <div style="font-size:28px;">DaiVUE</div>
+        <div>简易VUE网站快速成型框架</div>
+        <div>功能模块示例</div>
+    </div>
+</template>
+<script type="text/javascript">
+// import '../static/style/style.less';
+import { Vuex } from 'dai-vue';
+export default {
+    props: {},
+    data() {
+        return {};
+    },
+    components: {},
+    methods: {},
+    watch: {},
+    created() {},
+    mounted() {},
+    //计算属性
+    computed: {
+        ...Vuex.mapGetters(['vx_userInfo'])
+    },
+    destroyed() {}
+};
+</script>
\ No newline at end of file

routes.js 11(+11 -0)

diff --git a/routes.js b/routes.js
new file mode 100644
index 0000000..479df43
--- /dev/null
+++ b/routes.js
@@ -0,0 +1,11 @@
+import config from './config.js';
+const routes = [
+    {
+        path: '/test',
+        component: { template: '<router-view class="'+config.className+'"></router-view>' },
+        children: [
+            { path: 'index', component: () => import('./page/index.vue'), meta: { pageName: '模块模板' } }
+        ]
+    }
+];
+export default routes;
diff --git a/static/image/vue-logo.png b/static/image/vue-logo.png
new file mode 100644
index 0000000..102329c
Binary files /dev/null and b/static/image/vue-logo.png differ
diff --git a/static/style/style.less b/static/style/style.less
new file mode 100644
index 0000000..949f57a
--- /dev/null
+++ b/static/style/style.less
@@ -0,0 +1,4 @@
+//模块内样式
+.module-test{
+    background-color: #f00;
+}
\ No newline at end of file