提交 2fcbbcb5 编写于 作者: J jiulang9

Sun Jul 7 02:22:00 CST 2024 inscode

上级 04bbf5e8
......@@ -7,6 +7,7 @@
"preview": "vite preview --port 4173"
},
"dependencies": {
"axios": "^1.7.2",
"guess": "^1.0.2",
"vue": "^3.2.37"
},
......
......@@ -14,72 +14,82 @@ import SupportIcon from './icons/IconSupport.vue'
</template>
<template #heading>Documentation</template>
Vue’s
<a target="_blank" href="https://vuejs.org/">official documentation</a>
provides you with all information you need to get started.
<div class="input-container">
<input type="text" v-model="inputValue" placeholder="Enter your query" />
<button @click="handleSubmit">Submit</button>
</div>
<div v-if="searchResults">
<h3>Search Results</h3>
<ul>
<li v-for="result in searchResults" :key="result.id">
<a :href="result.url">{{ result.title }}</a>
</li>
</ul>
</div>
</WelcomeItem>
<WelcomeItem>
<template #icon>
<ToolingIcon />
</template>
<template #heading>Tooling</template>
</template>
This project is served and bundled with
<a href="https://vitejs.dev/guide/features.html" target="_blank">Vite</a>. The recommended IDE
setup is <a href="https://code.visualstudio.com/" target="_blank">VSCode</a> +
<a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>. If you need to test
your components and web pages, check out
<a href="https://www.cypress.io/" target="_blank">Cypress</a> and
<a href="https://on.cypress.io/component" target="_blank"
>Cypress Component Testing</a
>.
<script>
<br />
import axios from 'axios';
More instructions are available in <code>README.md</code>.
</WelcomeItem>
export default {
data() {
return {
inputValue: '',
searchResults: null
};
},
methods: {
async handleSubmit() {
try {
const response = await axios.get(`https://api.example.com/search?q=${this.inputValue}`);
this.searchResults = response.data.results;
} catch (error) {
console.log(error);
}
}
}
};
</script>
<WelcomeItem>
<template #icon>
<EcosystemIcon />
</template>
<template #heading>Ecosystem</template>
<style>
.input-container {
display: flex;
justify-content: center;
margin-bottom: 20px;
}
Get official tools and libraries for your project:
<a target="_blank" href="https://pinia.vuejs.org/">Pinia</a>,
<a target="_blank" href="https://router.vuejs.org/">Vue Router</a>,
<a target="_blank" href="https://test-utils.vuejs.org/">Vue Test Utils</a>, and
<a target="_blank" href="https://github.com/vuejs/devtools">Vue Dev Tools</a>. If you need more
resources, we suggest paying
<a target="_blank" href="https://github.com/vuejs/awesome-vue">Awesome Vue</a>
a visit.
</WelcomeItem>
input[type="text"] {
padding: 10px;
border: 2px solid #ccc;
border-radius: 4px;
margin-right: 10px;
}
<WelcomeItem>
<template #icon>
<CommunityIcon />
</template>
<template #heading>Community</template>
button {
padding: 10px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
Got stuck? Ask your question on
<a target="_blank" href="https://chat.vuejs.org">Vue Land</a>, our official Discord server, or
<a target="_blank" href="https://stackoverflow.com/questions/tagged/vue.js">StackOverflow</a>.
You should also subscribe to
<a target="_blank" href="https://news.vuejs.org">our mailing list</a> and follow the official
<a target="_blank" href="https://twitter.com/vuejs">@vuejs</a>
twitter account for latest news in the Vue world.
</WelcomeItem>
button:hover {
background-color: #3e8e41;
}
<WelcomeItem>
<template #icon>
<SupportIcon />
</template>
<template #heading>Support Vue</template>
ul {
list-style: none;
margin: 0;
padding: 0;
}
li {
margin-bottom: 10px;
}
</style>
As an independent project, Vue relies on community backing for its sustainability. You can help
us by
<a target="_blank" href="https://vuejs.org/sponsor/">becoming a sponsor</a>.
</WelcomeItem>
</template>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册