Fri May 26 08:36:00 UTC 2023 inscode

上级 a5450115
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
"preview": "vite preview --port 4173" "preview": "vite preview --port 4173"
}, },
"dependencies": { "dependencies": {
"@vueuse/core": "^10.1.2",
"guess": "^1.0.2", "guess": "^1.0.2",
"pinia": "^2.0.0-rc.10",
"vue": "^3.2.37" "vue": "^3.2.37"
}, },
"devDependencies": { "devDependencies": {
......
<script setup>
import HelloWorld from './components/HelloWorld.vue'
import TheWelcome from './components/TheWelcome.vue'
</script>
<template> <template>
<header> <header>
22232323
<img alt="Vue logo" class="logo" src="./assets/logo.svg" width="125" height="125" /> <img alt="Vue logo" class="logo" src="./assets/logo.svg" width="125" height="125" />
<div class="wrapper"> <div class="wrapper">
...@@ -16,7 +14,29 @@ import TheWelcome from './components/TheWelcome.vue' ...@@ -16,7 +14,29 @@ import TheWelcome from './components/TheWelcome.vue'
<TheWelcome /> <TheWelcome />
</main> </main>
</template> </template>
<script setup>
import HelloWorld from './components/HelloWorld.vue'
import TheWelcome from './components/TheWelcome.vue'
import { ref, onMounted } from 'vue'
onMounted(() => {
let arr = [4, 2, 8, 1, 5];
console.log(bubbleSort(arr)); // [1, 2, 4, 5, 8]
function bubbleSort(arr) {
var len = arr.length;
for (var i = 0; i < len - 1; i++) {
for (var j = 0; j < len - 1 - i; j++) {
if (arr[j] > arr[j + 1]) {
var temp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = temp;
}
}
}
return arr;
}
bubbleSort()
})
</script>
<style scoped> <style scoped>
header { header {
line-height: 1.5; line-height: 1.5;
......
<script setup>
<template>
<div class="greetings">
222
Count:{{ count}}
<button @click="increment">Increment</button>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { useStore } from 'pinia'
defineProps({ defineProps({
msg: { msg: {
type: String, type: String,
required: true required: true
} }
}) })
</script>
<template> export default defineComponent({
<div class="greetings"> setup(){
<h1 class="green">{{ msg }}</h1> const store = useStore();
<h3> const count = store.count;
You’ve successfully created a project with const increment = () =>{
<a target="_blank" href="https://vitejs.dev/">Vite</a> + store.count++;
<a target="_blank" href="https://vuejs.org/">Vue 3</a>. };
</h3> return {
</div> count,
</template> increment
}
}
})
</script>
<style scoped> <style scoped>
h1 { h1 {
font-weight: 500; font-weight: 500;
......
<script setup> <script setup>
import { ref, onMounted } from 'vue'
import WelcomeItem from './WelcomeItem.vue' import WelcomeItem from './WelcomeItem.vue'
import DocumentationIcon from './icons/IconDocumentation.vue' import DocumentationIcon from './icons/IconDocumentation.vue'
import ToolingIcon from './icons/IconTooling.vue' import ToolingIcon from './icons/IconTooling.vue'
import EcosystemIcon from './icons/IconEcosystem.vue' import EcosystemIcon from './icons/IconEcosystem.vue'
import CommunityIcon from './icons/IconCommunity.vue' import CommunityIcon from './icons/IconCommunity.vue'
import SupportIcon from './icons/IconSupport.vue' import SupportIcon from './icons/IconSupport.vue'
onMounted(() => {
let arr = [4, 2, 8, 1, 5];
console.log(bubbleSort(arr)); // [1, 2, 4, 5, 8]
function bubbleSort(arr) {
var len = arr.length;
for (var i = 0; i < len - 1; i++) {
for (var j = 0; j < len - 1 - i; j++) {
if (arr[j] > arr[j + 1]) {
var temp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = temp;
}
}
}
return arr;
}
bubbleSort()
})
</script> </script>
<template> <template>
...@@ -31,9 +55,7 @@ import SupportIcon from './icons/IconSupport.vue' ...@@ -31,9 +55,7 @@ import SupportIcon from './icons/IconSupport.vue'
<a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>. If you need to test <a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>. If you need to test
your components and web pages, check out your components and web pages, check out
<a href="https://www.cypress.io/" target="_blank">Cypress</a> and <a href="https://www.cypress.io/" target="_blank">Cypress</a> and
<a href="https://on.cypress.io/component" target="_blank" <a href="https://on.cypress.io/component" target="_blank">Cypress Component Testing</a>.
>Cypress Component Testing</a
>.
<br /> <br />
......
import { createPinia } from "pinia";
const pinia = createPinia();
export default pinia
\ No newline at end of file
import { createApp } from 'vue' import { createApp } from 'vue'
import App from './App.vue' import App from './App.vue'
import pinia from './index'
import './assets/main.css' import './assets/main.css'
createApp(App).mount('#app') const app = createApp(App);
app.use(pinia)
app.mount('#app')
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册