shaogen1995 3 år sedan
förälder
incheckning
5902922522

+ 19 - 0
web/README.md

@@ -0,0 +1,19 @@
+# shou_bo
+
+## Project setup
+```
+npm install
+```
+
+### Compiles and hot-reloads for development
+```
+npm run serve
+```
+
+### Compiles and minifies for production
+```
+npm run build
+```
+
+### Customize configuration
+See [Configuration Reference](https://cli.vuejs.org/config/).

+ 5 - 0
web/babel.config.js

@@ -0,0 +1,5 @@
+module.exports = {
+  presets: [
+    '@vue/cli-plugin-babel/preset'
+  ]
+}

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 25959 - 0
web/package-lock.json


+ 27 - 0
web/package.json

@@ -0,0 +1,27 @@
+{
+  "name": "shou_bo",
+  "version": "0.1.0",
+  "private": true,
+  "scripts": {
+    "serve": "vue-cli-service serve",
+    "build": "vue-cli-service build"
+  },
+  "dependencies": {
+    "core-js": "^3.6.5",
+    "vue": "^2.6.11",
+    "vue-router": "^3.2.0"
+  },
+  "devDependencies": {
+    "@vue/cli-plugin-babel": "~4.5.13",
+    "@vue/cli-plugin-router": "~4.5.13",
+    "@vue/cli-service": "~4.5.13",
+    "less": "^3.0.4",
+    "less-loader": "^5.0.0",
+    "vue-template-compiler": "^2.6.11"
+  },
+  "browserslist": [
+    "> 1%",
+    "last 2 versions",
+    "not dead"
+  ]
+}

BIN
web/public/favicon.ico


+ 17 - 0
web/public/index.html

@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="">
+  <head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width,initial-scale=1.0">
+    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
+    <title>Capital Museum.China</title>
+  </head>
+  <body>
+    <noscript>
+      <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
+    </noscript>
+    <div id="app"></div>
+    <!-- built files will be auto injected -->
+  </body>
+</html>

+ 15 - 0
web/src/App.vue

@@ -0,0 +1,15 @@
+<template>
+  <div id="app">
+    <Router-view/>
+  </div>
+</template>
+
+<style lang='less' scoped>
+#app{
+  width: 100vw;
+  height: 100vh;
+  min-width: 1900px;
+  min-height: 900px;
+}
+</style>
+

+ 51 - 0
web/src/assets/css/base.css

@@ -0,0 +1,51 @@
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, canvas, details, embed, 
+figure, figcaption, footer, header, hgroup, 
+menu, nav, output, ruby, section, summary,
+time, mark, audio, video {
+    margin: 0;
+    padding: 0;
+    border: 0;
+    font-size: 100%;
+    font: inherit;
+    vertical-align: baseline;
+}
+/* HTML5 display-role reset for older browsers */
+article, aside, details, figcaption, figure, 
+footer, header, hgroup, menu, nav, section {
+    display: block;
+}
+body {
+    line-height: 1;
+}
+ol, ul {
+    list-style: none;
+}
+blockquote, q {
+    quotes: none;
+}
+blockquote:before, blockquote:after,
+q:before, q:after {
+    content: '';
+    content: none;
+}
+table {
+    border-collapse: collapse;
+    border-spacing: 0;
+}
+a{
+    color: #000;
+    text-decoration: none;
+}
+a:hover{
+    color: #000;
+    text-decoration: none;
+}

BIN
web/src/assets/images/logo.png


+ 12 - 0
web/src/main.js

@@ -0,0 +1,12 @@
+import Vue from 'vue'
+import App from './App.vue'
+import router from './router'
+
+Vue.config.productionTip = false
+//引入初始化样式
+import './assets/css/base.css'
+
+new Vue({
+  router,
+  render: h => h(App)
+}).$mount('#app')

+ 28 - 0
web/src/router/index.js

@@ -0,0 +1,28 @@
+import Vue from 'vue'
+import VueRouter from 'vue-router'
+
+Vue.use(VueRouter)
+
+const routes = [
+  {
+    path: '/',
+    name: 'Layout',
+    component: () => import( '../views/layout/index.vue'),
+    redirect: { name: 'Home' },
+    children: [
+      {
+        path:'Home',
+        name:'Home',
+        component: () => import( '../views/Home/index.vue'),
+      }
+    ]
+  }
+]
+
+const router = new VueRouter({
+  // mode: 'history',
+  base: process.env.BASE_URL,
+  routes
+})
+
+export default router

+ 43 - 0
web/src/views/Home/index.vue

@@ -0,0 +1,43 @@
+<template>
+<div class='Home'>Home</div>
+</template>
+
+<script>
+export default {
+name:'Home',
+components: {},
+data() {
+//这里存放数据
+return {
+
+};
+},
+//监听属性 类似于data概念
+computed: {},
+//监控data中的数据变化
+watch: {},
+//方法集合
+methods: {
+
+},
+//生命周期 - 创建完成(可以访问当前this实例)
+created() {
+
+},
+//生命周期 - 挂载完成(可以访问DOM元素)
+mounted() {
+
+},
+beforeCreate() {}, //生命周期 - 创建之前
+beforeMount() {}, //生命周期 - 挂载之前
+beforeUpdate() {}, //生命周期 - 更新之前
+updated() {}, //生命周期 - 更新之后
+beforeDestroy() {}, //生命周期 - 销毁之前
+destroyed() {}, //生命周期 - 销毁完成
+activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+}
+</script>
+<style lang='less' scoped>
+//@import url(); 引入公共css类
+
+</style>

+ 161 - 0
web/src/views/layout/index.vue

@@ -0,0 +1,161 @@
+<template>
+  <div class="Layout">
+    <!-- 公共头部 -->
+    <div class="topNav">
+      <div class="mainbav_wrap">
+        <h1 class="logo">
+          <img src="@/assets/images/logo.png" alt="" />
+        </h1>
+        <ul class="mainbav">
+          <li class=""></li>
+        </ul>
+      </div>
+    </div>
+    <!-- 嵌套路由 -->
+    <Router-view />
+  </div>
+</template>
+
+<script>
+export default {
+  name: "Layout",
+  components: {},
+  data() {
+    //这里存放数据
+    return {
+      topData: [
+        { id: 1, name: "Home", url: "Home" },
+        {
+          id: 2,
+          name: "Visit",
+          url: "Visit",
+          children: [
+            { id: 2.1, name: "Hours, Direction & Admission" },
+            { id: 2.2, name: "Reservation" },
+            { id: 2.3, name: "Floor Plans" },
+            { id: 2.4, name: "Audio Guide & Tour" },
+            { id: 2.5, name: "Accessibility" },
+            { id: 2.6, name: "Café & Shop" },
+            { id: 2.7, name: "Visitor Guidelines" },
+          ],
+        },
+        {
+          id: 3,
+          name: "Exhibitions",
+          url: "Exhibitions",
+          children: [
+            { id: 3.1, name: "Current Exhibitions" },
+            { id: 3.2, name: "Permanent Exhibitions" },
+            { id: 3.3, name: "Past Exhibitions" },
+            { id: 3.4, name: "Overseas Exhibitions" },
+          ],
+        },
+        {
+          id: 4,
+          name: "Collections",
+          url: "Collections",
+          children: [
+            { id: 4.1, name: "Bronzes" },
+            { id: 4.2, name: "Ceramics" },
+            { id: 4.3, name: "Buddhist Statues" },
+            { id: 4.4, name: "Jadewares" },
+            { id: 4.5, name: "Calligraphies" },
+            { id: 4.6, name: "Paintings" },
+            { id: 4.7, name: "Gold & Silverwares" },
+            { id: 4.8, name: "Coins & Banknotes" },
+            { id: 4.9, name: "Brocades & Embroideries" },
+            { id: 4.1, name: "Cultural Supplies" },
+            { id: 4.11, name: "Miscellaneous" },
+          ],
+        },
+        {
+          id: 5,
+          name: "Learn & Engage",
+          url: "LearnEngage",
+          children: [
+            { id: 5.1, name: "For Students" },
+            { id: 5.2, name: "For Adults" },
+            { id: 5.3, name: "For Families & Children" },
+          ],
+        },
+        {
+          id: 6,
+          name: "Publications",
+          url: "Publications",
+          children: [
+            { id: 6.1, name: "Magazines" },
+            { id: 6.2, name: "Exhibition Catalogues" },
+            { id: 6.3, name: "Exhibition Brochures" },
+          ],
+        },
+        {
+          id: 7,
+          name: "Join & Support",
+          url: "JoinSupport",
+          children: [
+            { id: 7.1, name: "Ways to Volunteer" },
+            { id: 7.2, name: "Ways to Give" },
+          ],
+        },
+        {
+          id: 8,
+          name: "About",
+          url: "About",
+          children: [
+            { id: 8.1, name: "From the Director" },
+            { id: 8.2, name: "History" },
+            { id: 8.3, name: "Partners & Connections" },
+            { id: 8.4, name: "Contact" },
+          ],
+        },
+      ],
+    };
+  },
+  //监听属性 类似于data概念
+  computed: {},
+  //监控data中的数据变化
+  watch: {},
+  //方法集合
+  methods: {},
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {},
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {},
+  beforeCreate() {}, //生命周期 - 创建之前
+  beforeMount() {}, //生命周期 - 挂载之前
+  beforeUpdate() {}, //生命周期 - 更新之前
+  updated() {}, //生命周期 - 更新之后
+  beforeDestroy() {}, //生命周期 - 销毁之前
+  destroyed() {}, //生命周期 - 销毁完成
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+<style lang='less' scoped>
+.Layout {
+  position: relative;
+  width: 100%;
+  height: 100%;
+}
+.topNav {
+  background-color: rgba(0, 0, 0, 0.8);
+  width: 100%;
+  height: 60px;
+  position: absolute;
+  top: 0;
+  left: 0;
+  z-index: 999;
+  .mainbav_wrap {
+    width: 1200px;
+    margin: 0 auto;
+    & > h1 {
+      float: left;
+      display: inherit;
+      margin: 10px 70px 0 0;
+      & > img {
+        border: none;
+        vertical-align: top;
+      }
+    }
+  }
+}
+</style>