浏览代码

使用自己定义的:vue基本项目框架

Your Name 2 年之前
父节点
当前提交
9e50647fe2
共有 4 个文件被更改,包括 35 次插入64 次删除
  1. 6 24
      src/App.vue
  2. 0 40
      src/components/HelloWorld.vue
  3. 15 0
      src/views/Home.vue
  4. 14 0
      src/views/SearchBar.vue

+ 6 - 24
src/App.vue

@@ -1,30 +1,12 @@
 <script setup>
-import HelloWorld from './components/HelloWorld.vue'
+    import { ref } from 'vue'
+    import Home from './views/Home.vue';
 </script>
 
 <template>
-  <div>
-    <a href="https://vitejs.dev" target="_blank">
-      <img src="/vite.svg" class="logo" alt="Vite logo" />
-    </a>
-    <a href="https://vuejs.org/" target="_blank">
-      <img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
-    </a>
-  </div>
-  <HelloWorld msg="Vite + Vue" />
+  <Home></Home>
 </template>
 
-<style scoped>
-.logo {
-  height: 6em;
-  padding: 1.5em;
-  will-change: filter;
-  transition: filter 300ms;
-}
-.logo:hover {
-  filter: drop-shadow(0 0 2em #646cffaa);
-}
-.logo.vue:hover {
-  filter: drop-shadow(0 0 2em #42b883aa);
-}
-</style>
+<style lang="css">
+    
+</style>

+ 0 - 40
src/components/HelloWorld.vue

@@ -1,40 +0,0 @@
-<script setup>
-import { ref } from 'vue'
-
-defineProps({
-  msg: String,
-})
-
-const count = ref(0)
-</script>
-
-<template>
-  <h1>{{ msg }}</h1>
-
-  <div class="card">
-    <button type="button" @click="count++">count is {{ count }}</button>
-    <p>
-      Edit
-      <code>components/HelloWorld.vue</code> to test HMR
-    </p>
-  </div>
-
-  <p>
-    Check out
-    <a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
-      >create-vue</a
-    >, the official Vue + Vite starter
-  </p>
-  <p>
-    Install
-    <a href="https://github.com/vuejs/language-tools" target="_blank">Volar</a>
-    in your IDE for a better DX
-  </p>
-  <p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
-</template>
-
-<style scoped>
-.read-the-docs {
-  color: #888;
-}
-</style>

+ 15 - 0
src/views/Home.vue

@@ -0,0 +1,15 @@
+<script setup>
+    import { ref } from 'vue'
+    import Searchbar from './SearchBar.vue'
+</script>
+
+<template>
+    <!-- main 一个标签,你可以当成div -->
+    <main>
+        <Searchbar></Searchbar>
+    </main>
+</template>
+
+<style lang="css">
+    
+</style>

+ 14 - 0
src/views/SearchBar.vue

@@ -0,0 +1,14 @@
+<script setup>
+    import { ref } from 'vue'
+    
+</script>
+
+<template>
+    <div class="search-container">
+        search
+    </div>
+</template>
+
+<style lang="css">
+    
+</style>